Commit 16735b04 by Scott

Copy unmerged changes to Controllers

parent 7597bced
...@@ -115,8 +115,8 @@ class UserProfile extends \Q2A\Controllers\BaseController ...@@ -115,8 +115,8 @@ class UserProfile extends \Q2A\Controllers\BaseController
if (isset($loginuserid) && $loginuserid != $userid && if (isset($loginuserid) && $loginuserid != $userid &&
($loginlevel >= QA_USER_LEVEL_SUPER || $loginlevel > $maxuserlevel) && ($loginlevel >= QA_USER_LEVEL_SUPER || $loginlevel > $maxuserlevel) &&
!qa_user_permit_error() !qa_user_permit_error()
) { // can't change self - or someone on your level (or higher, obviously) unless you're a super admin ) {
// can't change self - or someone on your level (or higher, obviously) unless you're a super admin
if ($loginlevel >= QA_USER_LEVEL_SUPER) { if ($loginlevel >= QA_USER_LEVEL_SUPER) {
$maxlevelassign = QA_USER_LEVEL_SUPER; $maxlevelassign = QA_USER_LEVEL_SUPER;
} elseif ($loginlevel >= QA_USER_LEVEL_ADMIN) { } elseif ($loginlevel >= QA_USER_LEVEL_ADMIN) {
...@@ -194,9 +194,11 @@ class UserProfile extends \Q2A\Controllers\BaseController ...@@ -194,9 +194,11 @@ class UserProfile extends \Q2A\Controllers\BaseController
if (isset($useraccount['avatarblobid'])) { if (isset($useraccount['avatarblobid'])) {
require_once QA_INCLUDE_DIR . 'app/blobs.php'; require_once QA_INCLUDE_DIR . 'app/blobs.php';
qa_db_user_set($userid, 'avatarblobid', null); qa_db_user_set($userid, array(
qa_db_user_set($userid, 'avatarwidth', null); 'avatarblobid' => null,
qa_db_user_set($userid, 'avatarheight', null); 'avatarwidth' => null,
'avatarheight' => null,
));
qa_delete_blob($useraccount['avatarblobid']); qa_delete_blob($useraccount['avatarblobid']);
} }
} }
...@@ -606,7 +608,7 @@ class UserProfile extends \Q2A\Controllers\BaseController ...@@ -606,7 +608,7 @@ class UserProfile extends \Q2A\Controllers\BaseController
$htmlemail = qa_html(isset($inemail) ? $inemail : $useraccount['email']); $htmlemail = qa_html(isset($inemail) ? $inemail : $useraccount['email']);
$qa_content['form_profile']['fields']['email'] = array( $qa_content['form_profile']['fields']['email'] = array(
'type' => $userediting ? 'text' : 'static', 'type' => $userediting ? 'email' : 'static',
'label' => qa_lang_html('users/email_label'), 'label' => qa_lang_html('users/email_label'),
'tags' => 'name="email"', 'tags' => 'name="email"',
'value' => $userediting ? $htmlemail : ('<a href="mailto:' . $htmlemail . '">' . $htmlemail . '</a>'), 'value' => $userediting ? $htmlemail : ('<a href="mailto:' . $htmlemail . '">' . $htmlemail . '</a>'),
......
...@@ -190,7 +190,7 @@ class UsersList extends \Q2A\Controllers\BaseController ...@@ -190,7 +190,7 @@ class UsersList extends \Q2A\Controllers\BaseController
'items' => array(), 'items' => array(),
'rows' => ceil($pageSize / qa_opt('columns_users')), 'rows' => ceil($pageSize / qa_opt('columns_users')),
'type' => 'users', 'type' => 'users',
// 'sort' => '', // 'sort' is handled by calling code
); );
foreach ($users as $user) { foreach ($users as $user) {
...@@ -219,9 +219,7 @@ class UsersList extends \Q2A\Controllers\BaseController ...@@ -219,9 +219,7 @@ class UsersList extends \Q2A\Controllers\BaseController
$content['page_links'] = qa_html_page_links($request, $start, $pageSize, $totalUsers, qa_opt('pages_prev_next')); $content['page_links'] = qa_html_page_links($request, $start, $pageSize, $totalUsers, qa_opt('pages_prev_next'));
// set the canonical url based on possible pagination $content['canonical'] = qa_get_canonical();
$params = $start > 0 ? array('start' => $start) : null;
$content['canonical'] = qa_path_html($request, $params, qa_opt('site_url'));
$content['navigation']['sub'] = qa_users_sub_navigation(); $content['navigation']['sub'] = qa_users_sub_navigation();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment