@@ -144,33 +144,33 @@ discard block |
||
| 144 | 144 | $algorithm = 'UNCRYPT'; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $salt = md5($password . $seed); |
|
| 147 | + $salt = md5($password.$seed); |
|
| 148 | 148 | |
| 149 | 149 | switch ($algorithm) { |
| 150 | 150 | case 'BLOWFISH_Y': |
| 151 | - $salt = '$2y$07$' . substr($salt, 0, 22); |
|
| 151 | + $salt = '$2y$07$'.substr($salt, 0, 22); |
|
| 152 | 152 | break; |
| 153 | 153 | case 'BLOWFISH_A': |
| 154 | - $salt = '$2a$07$' . substr($salt, 0, 22); |
|
| 154 | + $salt = '$2a$07$'.substr($salt, 0, 22); |
|
| 155 | 155 | break; |
| 156 | 156 | case 'SHA512': |
| 157 | - $salt = '$6$' . substr($salt, 0, 16); |
|
| 157 | + $salt = '$6$'.substr($salt, 0, 16); |
|
| 158 | 158 | break; |
| 159 | 159 | case 'SHA256': |
| 160 | - $salt = '$5$' . substr($salt, 0, 16); |
|
| 160 | + $salt = '$5$'.substr($salt, 0, 16); |
|
| 161 | 161 | break; |
| 162 | 162 | case 'MD5': |
| 163 | - $salt = '$1$' . substr($salt, 0, 8); |
|
| 163 | + $salt = '$1$'.substr($salt, 0, 8); |
|
| 164 | 164 | break; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | if ($algorithm !== 'UNCRYPT') { |
| 168 | - $password = sha1($password) . crypt($password, $salt); |
|
| 168 | + $password = sha1($password).crypt($password, $salt); |
|
| 169 | 169 | } else { |
| 170 | - $password = sha1($salt . $password); |
|
| 170 | + $password = sha1($salt.$password); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - $result = strtolower($algorithm) . '>' . md5($salt . $password) . substr(md5($salt), 0, 8); |
|
| 173 | + $result = strtolower($algorithm).'>'.md5($salt.$password).substr(md5($salt), 0, 8); |
|
| 174 | 174 | |
| 175 | 175 | return $result; |
| 176 | 176 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $check_files = explode("\n", $check_files); |
| 253 | 253 | foreach ($check_files as $file) { |
| 254 | 254 | $file = trim($file); |
| 255 | - $file = MODX_BASE_PATH . $file; |
|
| 255 | + $file = MODX_BASE_PATH.$file; |
|
| 256 | 256 | if (!is_file($file)) { |
| 257 | 257 | continue; |
| 258 | 258 | } |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | $checksum = unserialize($checksum); |
| 276 | 276 | foreach ($check_files as $file) { |
| 277 | 277 | $file = trim($file); |
| 278 | - $filePath = MODX_BASE_PATH . $file; |
|
| 278 | + $filePath = MODX_BASE_PATH.$file; |
|
| 279 | 279 | if (!is_file($filePath)) { |
| 280 | 280 | continue; |
| 281 | 281 | } |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | { |
| 295 | 295 | $modx = evolutionCMS(); |
| 296 | 296 | $tbl_system_settings = $modx->getFullTableName('system_settings'); |
| 297 | - $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','" . $modx->db->escape($checksum) . "')"; |
|
| 297 | + $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','".$modx->db->escape($checksum)."')"; |
|
| 298 | 298 | $modx->db->query($sql); |
| 299 | 299 | } |
| 300 | 300 | |
@@ -371,10 +371,10 @@ discard block |
||
| 371 | 371 | foreach ($settings as $key => $val) { |
| 372 | 372 | $f = array(); |
| 373 | 373 | $f['user'] = $_SESSION['mgrInternalKey']; |
| 374 | - $f['setting_name'] = '_LAST_' . $key; |
|
| 374 | + $f['setting_name'] = '_LAST_'.$key; |
|
| 375 | 375 | $f['setting_value'] = $val; |
| 376 | 376 | $f = $modx->db->escape($f); |
| 377 | - $f = "(`" . implode("`, `", array_keys($f)) . "`) VALUES('" . implode("', '", array_values($f)) . "')"; |
|
| 377 | + $f = "(`".implode("`, `", array_keys($f))."`) VALUES('".implode("', '", array_values($f))."')"; |
|
| 378 | 378 | $f .= " ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)"; |
| 379 | 379 | $modx->db->insert($f, $modx->getFullTableName('user_settings')); |
| 380 | 380 | } |
@@ -116,7 +116,8 @@ discard block |
||
| 116 | 116 | * @return string |
| 117 | 117 | */ |
| 118 | 118 | public function getHashType($db_value = '') |
| 119 | - { // md5 | v1 | phpass |
|
| 119 | + { |
|
| 120 | +// md5 | v1 | phpass |
|
| 120 | 121 | $c = substr($db_value, 0, 1); |
| 121 | 122 | if ($c === '$') { |
| 122 | 123 | return 'phpass'; |
@@ -135,7 +136,8 @@ discard block |
||
| 135 | 136 | * @return string |
| 136 | 137 | */ |
| 137 | 138 | public function genV1Hash($password, $seed = '1') |
| 138 | - { // $seed is user_id basically |
|
| 139 | + { |
|
| 140 | +// $seed is user_id basically |
|
| 139 | 141 | $modx = evolutionCMS(); |
| 140 | 142 | |
| 141 | 143 | if (isset($modx->config['pwd_hash_algo']) && !empty($modx->config['pwd_hash_algo'])) { |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class DATEPICKER {
|
| 4 | - function __construct() {
|
|
| 5 | - } |
|
| 4 | + function __construct() {
|
|
| 5 | + } |
|
| 6 | 6 | |
| 7 | - function getDP() {
|
|
| 8 | - $modx = evolutionCMS(); global $_lang; |
|
| 7 | + function getDP() {
|
|
| 8 | + $modx = evolutionCMS(); global $_lang; |
|
| 9 | 9 | |
| 10 | - $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
| 11 | - return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
| 12 | - } |
|
| 10 | + $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
| 11 | + return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
| 12 | + } |
|
| 13 | 13 | } |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class DATEPICKER {
|
|
| 4 | - function __construct() {
|
|
| 3 | +class DATEPICKER{
|
|
| 4 | + function __construct(){
|
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | - function getDP() {
|
|
| 7 | + function getDP(){
|
|
| 8 | 8 | $modx = evolutionCMS(); global $_lang; |
| 9 | 9 | |
| 10 | - $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
| 10 | + $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl'); |
|
| 11 | 11 | return $modx->parseText($tpl, $_lang, '[%', '%]'); |
| 12 | 12 | } |
| 13 | 13 | } |
@@ -1,10 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class DATEPICKER {
|
|
| 4 | - function __construct() {
|
|
| 3 | +class DATEPICKER |
|
| 4 | +{ |
|
| 5 | + function __construct() |
|
| 6 | + { |
|
| 5 | 7 | } |
| 6 | 8 | |
| 7 | - function getDP() {
|
|
| 9 | + function getDP() |
|
| 10 | + { |
|
| 8 | 11 | $modx = evolutionCMS(); global $_lang; |
| 9 | 12 | |
| 10 | 13 | $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | -class DATEPICKER { |
|
| 3 | - function __construct() { |
|
| 2 | +class DATEPICKER{ |
|
| 3 | + function __construct(){ |
|
| 4 | 4 | } |
| 5 | - function getDP() { |
|
| 5 | + function getDP(){ |
|
| 6 | 6 | $modx = evolutionCMS(); global$_lang; |
| 7 | 7 | |
| 8 | 8 | $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl'); |
| 9 | - return $modx->parseText($tpl,$_lang,'[%','%]'); |
|
| 9 | + return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
| 10 | 10 | } |
| 11 | 11 | } |
@@ -1,8 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | -class DATEPICKER { |
|
| 3 | - function __construct() { |
|
| 2 | +class DATEPICKER |
|
| 3 | +{ |
|
| 4 | + function __construct() |
|
| 5 | + { |
|
| 4 | 6 | } |
| 5 | - function getDP() { |
|
| 7 | + function getDP() |
|
| 8 | + { |
|
| 6 | 9 | $modx = evolutionCMS(); global$_lang; |
| 7 | 10 | |
| 8 | 11 | $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl'); |
@@ -492,7 +492,7 @@ |
||
| 492 | 492 | }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
| 493 | 493 | $publishedon = $pub_date; |
| 494 | 494 | $publishedby = $modx->getLoginUserID(); |
| 495 | - }elseif ($was_published && !$published) { |
|
| 495 | + }elseif ($was_published && !$published) { |
|
| 496 | 496 | $publishedon = 0; |
| 497 | 497 | $publishedby = 0; |
| 498 | 498 | } else { |
@@ -280,19 +280,19 @@ |
||
| 280 | 280 | // invoke OnBeforeDocFormSave event |
| 281 | 281 | switch($modx->config['docid_incrmnt_method']) |
| 282 | 282 | { |
| 283 | - case '1': |
|
| 284 | - $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
| 285 | - $where = "T1.id IS NULL"; |
|
| 286 | - $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
| 287 | - $id = $modx->db->getValue($rs); |
|
| 283 | + case '1': |
|
| 284 | + $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
| 285 | + $where = "T1.id IS NULL"; |
|
| 286 | + $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
| 287 | + $id = $modx->db->getValue($rs); |
|
| 288 | + break; |
|
| 289 | + case '2': |
|
| 290 | + $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
| 291 | + $id = $modx->db->getValue($rs); |
|
| 288 | 292 | break; |
| 289 | - case '2': |
|
| 290 | - $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
| 291 | - $id = $modx->db->getValue($rs); |
|
| 292 | - break; |
|
| 293 | 293 | |
| 294 | - default: |
|
| 295 | - $id = ''; |
|
| 294 | + default: |
|
| 295 | + $id = ''; |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | $modx->invokeEvent("OnBeforeDocFormSave", array( |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | case 'new' : |
| 279 | 279 | |
| 280 | 280 | // invoke OnBeforeDocFormSave event |
| 281 | - switch($modx->config['docid_incrmnt_method']) |
|
| 281 | + switch ($modx->config['docid_incrmnt_method']) |
|
| 282 | 282 | { |
| 283 | 283 | case '1': |
| 284 | 284 | $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | if (!$was_published && $published) { |
| 490 | 490 | $publishedon = $currentdate; |
| 491 | 491 | $publishedby = $modx->getLoginUserID(); |
| 492 | - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
| 492 | + }elseif ((!empty($pub_date) && $pub_date <= $currentdate && $published)) { |
|
| 493 | 493 | $publishedon = $pub_date; |
| 494 | 494 | $publishedby = $modx->getLoginUserID(); |
| 495 | 495 | }elseif ($was_published && !$published) { |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | // invoke OnBeforeDocFormSave event |
| 504 | - $modx->invokeEvent("OnBeforeDocFormSave", array ( |
|
| 504 | + $modx->invokeEvent("OnBeforeDocFormSave", array( |
|
| 505 | 505 | "mode" => "upd", |
| 506 | 506 | "id" => $id |
| 507 | 507 | )); |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | . "menuindex={$menuindex}, " |
| 527 | 527 | . "searchable={$searchable}, " |
| 528 | 528 | . "cacheable={$cacheable}, " |
| 529 | - . "editedby=" . $modx->getLoginUserID() . ", " |
|
| 529 | + . "editedby=".$modx->getLoginUserID().", " |
|
| 530 | 530 | . "editedon={$currentdate}, " |
| 531 | 531 | . "publishedon={$publishedon}, " |
| 532 | 532 | . "publishedby={$publishedby}, " |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | |
| 541 | 541 | // update template variables |
| 542 | 542 | $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'"); |
| 543 | - $tvIds = array (); |
|
| 543 | + $tvIds = array(); |
|
| 544 | 544 | while ($row = $modx->db->getRow($rs)) { |
| 545 | 545 | $tvIds[$row['tmplvarid']] = $row['id']; |
| 546 | 546 | } |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | 'groups.id, groups.document_group', |
| 594 | 594 | "{$tbl_document_groups} AS groups |
| 595 | 595 | LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group", |
| 596 | - "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
| 596 | + "((1=".(int) $isManager." AND dgn.private_memgroup) OR (1=".(int) $isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
| 597 | 597 | ); |
| 598 | 598 | $old_groups = array(); |
| 599 | 599 | while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | unset($old_groups[$group]); |
| 606 | 606 | continue; |
| 607 | 607 | } elseif ($link_id == 'new') { |
| 608 | - $insertions[] = '('.(int)$group.','.$id.')'; |
|
| 608 | + $insertions[] = '('.(int) $group.','.$id.')'; |
|
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | 611 | if (!empty($insertions)) { |
@@ -637,17 +637,17 @@ discard block |
||
| 637 | 637 | |
| 638 | 638 | |
| 639 | 639 | // invoke OnDocFormSave event |
| 640 | - $modx->invokeEvent("OnDocFormSave", array ( |
|
| 640 | + $modx->invokeEvent("OnDocFormSave", array( |
|
| 641 | 641 | "mode" => "upd", |
| 642 | 642 | "id" => $id |
| 643 | 643 | )); |
| 644 | 644 | |
| 645 | 645 | // secure web documents - flag as private |
| 646 | - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; |
|
| 646 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
| 647 | 647 | secureWebDocument($id); |
| 648 | 648 | |
| 649 | 649 | // secure manager documents - flag as private |
| 650 | - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; |
|
| 650 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
| 651 | 651 | secureMgrDocument($id); |
| 652 | 652 | |
| 653 | 653 | // Set the item name for logger |
@@ -673,13 +673,13 @@ discard block |
||
| 673 | 673 | // document |
| 674 | 674 | $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; |
| 675 | 675 | } |
| 676 | - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; |
|
| 676 | + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay'].$add_path; |
|
| 677 | 677 | } else { |
| 678 | 678 | $header = "Location: index.php?a=3&id=$id&r=1".$add_path; |
| 679 | 679 | } |
| 680 | 680 | } |
| 681 | 681 | if (headers_sent()) { |
| 682 | - $header = str_replace('Location: ','',$header); |
|
| 682 | + $header = str_replace('Location: ', '', $header); |
|
| 683 | 683 | echo "<script>document.location.href='$header';</script>\n"; |
| 684 | 684 | } else { |
| 685 | 685 | header($header); |
@@ -134,8 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | //end webber |
| 136 | 136 | } |
| 137 | -} |
|
| 138 | -elseif ($alias) { |
|
| 137 | +} elseif ($alias) { |
|
| 139 | 138 | $alias = $modx->stripAlias($alias); |
| 140 | 139 | } |
| 141 | 140 | |
@@ -149,8 +148,7 @@ discard block |
||
| 149 | 148 | |
| 150 | 149 | if ($pub_date < $currentdate) { |
| 151 | 150 | $published = 1; |
| 152 | - } |
|
| 153 | - elseif ($pub_date > $currentdate) { |
|
| 151 | + } elseif ($pub_date > $currentdate) { |
|
| 154 | 152 | $published = 0; |
| 155 | 153 | } |
| 156 | 154 | } |
@@ -278,8 +276,7 @@ discard block |
||
| 278 | 276 | case 'new' : |
| 279 | 277 | |
| 280 | 278 | // invoke OnBeforeDocFormSave event |
| 281 | - switch($modx->config['docid_incrmnt_method']) |
|
| 282 | - { |
|
| 279 | + switch($modx->config['docid_incrmnt_method']) { |
|
| 283 | 280 | case '1': |
| 284 | 281 | $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
| 285 | 282 | $where = "T1.id IS NULL"; |
@@ -347,8 +344,9 @@ discard block |
||
| 347 | 344 | "alias_visible" => $aliasvisible |
| 348 | 345 | ); |
| 349 | 346 | |
| 350 | - if ($id != '') |
|
| 351 | - $dbInsert["id"] = $id; |
|
| 347 | + if ($id != '') { |
|
| 348 | + $dbInsert["id"] = $id; |
|
| 349 | + } |
|
| 352 | 350 | |
| 353 | 351 | $key = $modx->db->insert($dbInsert, $tbl_site_content); |
| 354 | 352 | |
@@ -424,11 +422,13 @@ discard block |
||
| 424 | 422 | // redirect/stay options |
| 425 | 423 | if ($_POST['stay'] != '') { |
| 426 | 424 | // weblink |
| 427 | - if ($_POST['mode'] == "72") |
|
| 428 | - $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; |
|
| 425 | + if ($_POST['mode'] == "72") { |
|
| 426 | + $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; |
|
| 427 | + } |
|
| 429 | 428 | // document |
| 430 | - if ($_POST['mode'] == "4") |
|
| 431 | - $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
|
| 429 | + if ($_POST['mode'] == "4") { |
|
| 430 | + $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
|
| 431 | + } |
|
| 432 | 432 | $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; |
| 433 | 433 | } else { |
| 434 | 434 | $header = "Location: index.php?a=3&id=$key&r=1"; |
@@ -489,10 +489,10 @@ discard block |
||
| 489 | 489 | if (!$was_published && $published) { |
| 490 | 490 | $publishedon = $currentdate; |
| 491 | 491 | $publishedby = $modx->getLoginUserID(); |
| 492 | - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
| 492 | + } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
| 493 | 493 | $publishedon = $pub_date; |
| 494 | 494 | $publishedby = $modx->getLoginUserID(); |
| 495 | - }elseif ($was_published && !$published) { |
|
| 495 | + } elseif ($was_published && !$published) { |
|
| 496 | 496 | $publishedon = 0; |
| 497 | 497 | $publishedby = 0; |
| 498 | 498 | } else { |
@@ -548,7 +548,9 @@ discard block |
||
| 548 | 548 | $tvChanges = array(); |
| 549 | 549 | foreach ($tmplvars as $field => $value) { |
| 550 | 550 | if (!is_array($value)) { |
| 551 | - if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value]; |
|
| 551 | + if (isset($tvIds[$value])) { |
|
| 552 | + $tvDeletions[] = $tvIds[$value]; |
|
| 553 | + } |
|
| 552 | 554 | } else { |
| 553 | 555 | $tvId = $value[0]; |
| 554 | 556 | $tvVal = $value[1]; |
@@ -596,7 +598,9 @@ discard block |
||
| 596 | 598 | "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
| 597 | 599 | ); |
| 598 | 600 | $old_groups = array(); |
| 599 | - while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; |
|
| 601 | + while ($row = $modx->db->getRow($rs)) { |
|
| 602 | + $old_groups[$row['document_group']] = $row['id']; |
|
| 603 | + } |
|
| 600 | 604 | |
| 601 | 605 | // update the permissions in the database |
| 602 | 606 | $insertions = $deletions = array(); |
@@ -658,9 +662,9 @@ discard block |
||
| 658 | 662 | $modx->clearCache('full'); |
| 659 | 663 | } |
| 660 | 664 | |
| 661 | - if ($_POST['refresh_preview'] == '1') |
|
| 662 | - $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
| 663 | - else { |
|
| 665 | + if ($_POST['refresh_preview'] == '1') { |
|
| 666 | + $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
| 667 | + } else { |
|
| 664 | 668 | if ($_POST['stay'] != '2' && $id > 0) { |
| 665 | 669 | $modx->unlockElement(7, $id); |
| 666 | 670 | } |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | ?> |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | ?> |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | ?> |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | <?php |
| 114 | 114 | // invoke OnMiscSettingsRender event |
| 115 | 115 | $evtOut = $modx->invokeEvent('OnFileManagerSettingsRender');
|
| 116 | - if(is_array($evtOut)) echo implode("",$evtOut);
|
|
| 116 | + if (is_array($evtOut)) echo implode("", $evtOut);
|
|
| 117 | 117 | ?> |
| 118 | 118 | </td> |
| 119 | 119 | </tr> |
@@ -113,7 +113,9 @@ |
||
| 113 | 113 | <?php |
| 114 | 114 | // invoke OnMiscSettingsRender event |
| 115 | 115 | $evtOut = $modx->invokeEvent('OnFileManagerSettingsRender');
|
| 116 | - if(is_array($evtOut)) echo implode("",$evtOut);
|
|
| 116 | + if(is_array($evtOut)) { |
|
| 117 | + echo implode("",$evtOut); |
|
| 118 | + } |
|
| 117 | 119 | ?> |
| 118 | 120 | </td> |
| 119 | 121 | </tr> |
@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | switch($modx->manager->action) { |
| 7 | - case 12: |
|
| 8 | - if(!$modx->hasPermission('edit_user')) { |
|
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | - } |
|
| 11 | - break; |
|
| 12 | - case 11: |
|
| 13 | - if(!$modx->hasPermission('new_user')) { |
|
| 14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | - } |
|
| 16 | - break; |
|
| 17 | - default: |
|
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | + case 12: |
|
| 8 | + if(!$modx->hasPermission('edit_user')) { |
|
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | + } |
|
| 11 | + break; |
|
| 12 | + case 11: |
|
| 13 | + if(!$modx->hasPermission('new_user')) { |
|
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | + } |
|
| 16 | + break; |
|
| 17 | + default: |
|
| 18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -23,75 +23,75 @@ discard block |
||
| 23 | 23 | // check to see the snippet editor isn't locked |
| 24 | 24 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
| 25 | 25 | if($username = $modx->db->getValue($rs)) { |
| 26 | - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
| 26 | + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
| 27 | 27 | } |
| 28 | 28 | // end check for lock |
| 29 | 29 | |
| 30 | 30 | if($modx->manager->action == '12') { |
| 31 | - // get user attribute |
|
| 32 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
| 33 | - $userdata = $modx->db->getRow($rs); |
|
| 34 | - if(!$userdata) { |
|
| 35 | - $modx->webAlertAndQuit("No user returned!"); |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - |
|
| 39 | - // get user settings |
|
| 40 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
|
| 41 | - $usersettings = array(); |
|
| 42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
| 43 | - // manually extract so that user display settings are not overwritten |
|
| 44 | - foreach($usersettings as $k => $v) { |
|
| 45 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
| 46 | - ${$k} = $v; |
|
| 47 | - } |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - // get user name |
|
| 51 | - $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
|
| 52 | - $usernamedata = $modx->db->getRow($rs); |
|
| 53 | - if(!$usernamedata) { |
|
| 54 | - $modx->webAlertAndQuit("No user returned while getting username!"); |
|
| 55 | - } |
|
| 56 | - $_SESSION['itemname'] = $usernamedata['username']; |
|
| 31 | + // get user attribute |
|
| 32 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
| 33 | + $userdata = $modx->db->getRow($rs); |
|
| 34 | + if(!$userdata) { |
|
| 35 | + $modx->webAlertAndQuit("No user returned!"); |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + |
|
| 39 | + // get user settings |
|
| 40 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
|
| 41 | + $usersettings = array(); |
|
| 42 | + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
| 43 | + // manually extract so that user display settings are not overwritten |
|
| 44 | + foreach($usersettings as $k => $v) { |
|
| 45 | + if($k != 'manager_language' && $k != 'manager_theme') { |
|
| 46 | + ${$k} = $v; |
|
| 47 | + } |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + // get user name |
|
| 51 | + $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
|
| 52 | + $usernamedata = $modx->db->getRow($rs); |
|
| 53 | + if(!$usernamedata) { |
|
| 54 | + $modx->webAlertAndQuit("No user returned while getting username!"); |
|
| 55 | + } |
|
| 56 | + $_SESSION['itemname'] = $usernamedata['username']; |
|
| 57 | 57 | } else { |
| 58 | - $userdata = array(); |
|
| 59 | - $usersettings = array(); |
|
| 60 | - $usernamedata = array(); |
|
| 61 | - $_SESSION['itemname'] = $_lang["new_user"]; |
|
| 58 | + $userdata = array(); |
|
| 59 | + $usersettings = array(); |
|
| 60 | + $usernamedata = array(); |
|
| 61 | + $_SESSION['itemname'] = $_lang["new_user"]; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // avoid doubling htmlspecialchars (already encoded in DB) |
| 65 | 65 | foreach($userdata as $key => $val) { |
| 66 | - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
| 66 | + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
| 67 | 67 | }; |
| 68 | 68 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
| 69 | 69 | |
| 70 | 70 | // restore saved form |
| 71 | 71 | $formRestored = false; |
| 72 | 72 | if($modx->manager->hasFormValues()) { |
| 73 | - $modx->manager->loadFormValues(); |
|
| 74 | - // restore post values |
|
| 75 | - $userdata = array_merge($userdata, $_POST); |
|
| 76 | - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
| 77 | - $usernamedata['username'] = $userdata['newusername']; |
|
| 78 | - $usernamedata['oldusername'] = $_POST['oldusername']; |
|
| 79 | - $usersettings = array_merge($usersettings, $userdata); |
|
| 80 | - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
| 81 | - extract($usersettings, EXTR_OVERWRITE); |
|
| 73 | + $modx->manager->loadFormValues(); |
|
| 74 | + // restore post values |
|
| 75 | + $userdata = array_merge($userdata, $_POST); |
|
| 76 | + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
| 77 | + $usernamedata['username'] = $userdata['newusername']; |
|
| 78 | + $usernamedata['oldusername'] = $_POST['oldusername']; |
|
| 79 | + $usersettings = array_merge($usersettings, $userdata); |
|
| 80 | + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
| 81 | + extract($usersettings, EXTR_OVERWRITE); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | // include the country list language file |
| 85 | 85 | $_country_lang = array(); |
| 86 | 86 | include_once "lang/country/english_country.inc.php"; |
| 87 | 87 | if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
| 88 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
| 88 | + include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
| 89 | 89 | } |
| 90 | 90 | asort($_country_lang); |
| 91 | 91 | |
| 92 | 92 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
| 93 | 93 | if($which_browser == 'default') { |
| 94 | - $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
| 94 | + $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
| 95 | 95 | } |
| 96 | 96 | ?> |
| 97 | 97 | <script type="text/javascript"> |
@@ -201,14 +201,14 @@ discard block |
||
| 201 | 201 | <form action="index.php?a=32" method="post" name="userform"> |
| 202 | 202 | <?php |
| 203 | 203 | |
| 204 | - // invoke OnUserFormPrerender event |
|
| 205 | - $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
| 206 | - "id" => $user |
|
| 207 | - )); |
|
| 208 | - if(is_array($evtOut)) { |
|
| 209 | - echo implode("", $evtOut); |
|
| 210 | - } |
|
| 211 | - ?> |
|
| 204 | + // invoke OnUserFormPrerender event |
|
| 205 | + $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
| 206 | + "id" => $user |
|
| 207 | + )); |
|
| 208 | + if(is_array($evtOut)) { |
|
| 209 | + echo implode("", $evtOut); |
|
| 210 | + } |
|
| 211 | + ?> |
|
| 212 | 212 | <input type="hidden" name="mode" value="<?php echo $modx->manager->action; ?>"> |
| 213 | 213 | <input type="hidden" name="id" value="<?php echo $user ?>"> |
| 214 | 214 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
@@ -301,21 +301,21 @@ discard block |
||
| 301 | 301 | <td> </td> |
| 302 | 302 | <td><?php |
| 303 | 303 | |
| 304 | - $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); |
|
| 305 | - ?> |
|
| 304 | + $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); |
|
| 305 | + ?> |
|
| 306 | 306 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
| 307 | 307 | <?php |
| 308 | - while($row = $modx->db->getRow($rs)) { |
|
| 309 | - if($modx->manager->action == '11') { |
|
| 310 | - $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
| 311 | - } else { |
|
| 312 | - $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
| 313 | - } |
|
| 314 | - ?> |
|
| 308 | + while($row = $modx->db->getRow($rs)) { |
|
| 309 | + if($modx->manager->action == '11') { |
|
| 310 | + $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
| 311 | + } else { |
|
| 312 | + $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
| 313 | + } |
|
| 314 | + ?> |
|
| 315 | 315 | <option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option> |
| 316 | 316 | <?php |
| 317 | - } |
|
| 318 | - ?> |
|
| 317 | + } |
|
| 318 | + ?> |
|
| 319 | 319 | </select></td> |
| 320 | 320 | </tr> |
| 321 | 321 | <tr> |
@@ -360,10 +360,10 @@ discard block |
||
| 360 | 360 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
| 361 | 361 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
| 362 | 362 | <?php |
| 363 | - foreach($_country_lang as $key => $country) { |
|
| 364 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
| 365 | - } |
|
| 366 | - ?> |
|
| 363 | + foreach($_country_lang as $key => $country) { |
|
| 364 | + echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
| 365 | + } |
|
| 366 | + ?> |
|
| 367 | 367 | </select></td> |
| 368 | 368 | </tr> |
| 369 | 369 | <tr> |
@@ -439,21 +439,21 @@ discard block |
||
| 439 | 439 | <td><select name="manager_language" class="inputBox" onChange="documentDirty=true"> |
| 440 | 440 | <option value=""></option> |
| 441 | 441 | <?php |
| 442 | - $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
| 443 | - $dir = dir("includes/lang"); |
|
| 444 | - while($file = $dir->read()) { |
|
| 445 | - if(strpos($file, ".inc.php") > 0) { |
|
| 446 | - $endpos = strpos($file, "."); |
|
| 447 | - $languagename = substr($file, 0, $endpos); |
|
| 448 | - $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
| 449 | - ?> |
|
| 442 | + $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
| 443 | + $dir = dir("includes/lang"); |
|
| 444 | + while($file = $dir->read()) { |
|
| 445 | + if(strpos($file, ".inc.php") > 0) { |
|
| 446 | + $endpos = strpos($file, "."); |
|
| 447 | + $languagename = substr($file, 0, $endpos); |
|
| 448 | + $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
| 449 | + ?> |
|
| 450 | 450 | <option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option> |
| 451 | 451 | <?php |
| 452 | 452 | |
| 453 | - } |
|
| 454 | - } |
|
| 455 | - $dir->close(); |
|
| 456 | - ?> |
|
| 453 | + } |
|
| 454 | + } |
|
| 455 | + $dir->close(); |
|
| 456 | + ?> |
|
| 457 | 457 | </select></td> |
| 458 | 458 | </tr> |
| 459 | 459 | <tr> |
@@ -528,22 +528,22 @@ discard block |
||
| 528 | 528 | <td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());"> |
| 529 | 529 | <option value=""></option> |
| 530 | 530 | <?php |
| 531 | - $dir = dir("media/style/"); |
|
| 532 | - while($file = $dir->read()) { |
|
| 533 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
| 534 | - $themename = $file; |
|
| 535 | - if($themename === 'common') { |
|
| 536 | - continue; |
|
| 537 | - } |
|
| 538 | - $attr = 'value="' . $themename . '" '; |
|
| 539 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
| 540 | - $attr .= 'selected="selected" '; |
|
| 541 | - } |
|
| 542 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
| 543 | - } |
|
| 544 | - } |
|
| 545 | - $dir->close(); |
|
| 546 | - ?> |
|
| 531 | + $dir = dir("media/style/"); |
|
| 532 | + while($file = $dir->read()) { |
|
| 533 | + if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
| 534 | + $themename = $file; |
|
| 535 | + if($themename === 'common') { |
|
| 536 | + continue; |
|
| 537 | + } |
|
| 538 | + $attr = 'value="' . $themename . '" '; |
|
| 539 | + if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
| 540 | + $attr .= 'selected="selected" '; |
|
| 541 | + } |
|
| 542 | + echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
| 543 | + } |
|
| 544 | + } |
|
| 545 | + $dir->close(); |
|
| 546 | + ?> |
|
| 547 | 547 | </select> |
| 548 | 548 | <input type="hidden" name="theme_refresher" value=""></td> |
| 549 | 549 | </tr> |
@@ -579,15 +579,15 @@ discard block |
||
| 579 | 579 | <th><?php echo $_lang["which_browser_title"] ?></th> |
| 580 | 580 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
| 581 | 581 | <?php |
| 582 | - $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
| 583 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
| 584 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
| 585 | - $dir = str_replace('\\', '/', $dir); |
|
| 586 | - $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
| 587 | - $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
| 588 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
| 589 | - } |
|
| 590 | - ?> |
|
| 582 | + $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
| 583 | + echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
| 584 | + foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
| 585 | + $dir = str_replace('\\', '/', $dir); |
|
| 586 | + $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
| 587 | + $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
| 588 | + echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
| 589 | + } |
|
| 590 | + ?> |
|
| 591 | 591 | </select></td> |
| 592 | 592 | </tr> |
| 593 | 593 | <tr> |
@@ -664,17 +664,17 @@ discard block |
||
| 664 | 664 | <option value=""></option> |
| 665 | 665 | <?php |
| 666 | 666 | |
| 667 | - $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
| 668 | - // invoke OnRichTextEditorRegister event |
|
| 669 | - $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
| 670 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
| 671 | - if(is_array($evtOut)) { |
|
| 672 | - for($i = 0; $i < count($evtOut); $i++) { |
|
| 673 | - $editor = $evtOut[$i]; |
|
| 674 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
| 675 | - } |
|
| 676 | - } |
|
| 677 | - ?> |
|
| 667 | + $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
| 668 | + // invoke OnRichTextEditorRegister event |
|
| 669 | + $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
| 670 | + echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
| 671 | + if(is_array($evtOut)) { |
|
| 672 | + for($i = 0; $i < count($evtOut); $i++) { |
|
| 673 | + $editor = $evtOut[$i]; |
|
| 674 | + echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
| 675 | + } |
|
| 676 | + } |
|
| 677 | + ?> |
|
| 678 | 678 | </select></td> |
| 679 | 679 | </tr> |
| 680 | 680 | <tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>"> |
@@ -707,12 +707,12 @@ discard block |
||
| 707 | 707 | </tr> |
| 708 | 708 | </table> |
| 709 | 709 | <?php |
| 710 | - // invoke OnInterfaceSettingsRender event |
|
| 711 | - $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
| 712 | - if(is_array($evtOut)) { |
|
| 713 | - echo implode("", $evtOut); |
|
| 714 | - } |
|
| 715 | - ?> |
|
| 710 | + // invoke OnInterfaceSettingsRender event |
|
| 711 | + $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
| 712 | + if(is_array($evtOut)) { |
|
| 713 | + echo implode("", $evtOut); |
|
| 714 | + } |
|
| 715 | + ?> |
|
| 716 | 716 | </div> |
| 717 | 717 | |
| 718 | 718 | <!-- Photo --> |
@@ -761,39 +761,39 @@ discard block |
||
| 761 | 761 | </div> |
| 762 | 762 | <?php if($use_udperms == 1) { |
| 763 | 763 | |
| 764 | - $groupsarray = array(); |
|
| 765 | - |
|
| 766 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
| 767 | - $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
|
| 768 | - $groupsarray = $modx->db->getColumn('user_group', $rs); |
|
| 769 | - } |
|
| 770 | - // retain selected doc groups between post |
|
| 771 | - if(is_array($_POST['user_groups'])) { |
|
| 772 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 773 | - } |
|
| 774 | - ?> |
|
| 764 | + $groupsarray = array(); |
|
| 765 | + |
|
| 766 | + if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
| 767 | + $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
|
| 768 | + $groupsarray = $modx->db->getColumn('user_group', $rs); |
|
| 769 | + } |
|
| 770 | + // retain selected doc groups between post |
|
| 771 | + if(is_array($_POST['user_groups'])) { |
|
| 772 | + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 773 | + } |
|
| 774 | + ?> |
|
| 775 | 775 | <div class="tab-page" id="tabAccess"> |
| 776 | 776 | <h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2> |
| 777 | 777 | <script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script> |
| 778 | 778 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
| 779 | 779 | <?php |
| 780 | - $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
|
| 781 | - while($row = $modx->db->getRow($rs)) { |
|
| 782 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
| 783 | - } |
|
| 784 | - } |
|
| 785 | - ?> |
|
| 780 | + $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
|
| 781 | + while($row = $modx->db->getRow($rs)) { |
|
| 782 | + echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
| 783 | + } |
|
| 784 | + } |
|
| 785 | + ?> |
|
| 786 | 786 | </div> |
| 787 | 787 | </div> |
| 788 | 788 | </div> |
| 789 | 789 | <input type="submit" name="save" style="display:none"> |
| 790 | 790 | <?php |
| 791 | - // invoke OnUserFormRender event |
|
| 792 | - $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
| 793 | - "id" => $user |
|
| 794 | - )); |
|
| 795 | - if(is_array($evtOut)) { |
|
| 796 | - echo implode("", $evtOut); |
|
| 797 | - } |
|
| 798 | - ?> |
|
| 791 | + // invoke OnUserFormRender event |
|
| 792 | + $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
| 793 | + "id" => $user |
|
| 794 | + )); |
|
| 795 | + if(is_array($evtOut)) { |
|
| 796 | + echo implode("", $evtOut); |
|
| 797 | + } |
|
| 798 | + ?> |
|
| 799 | 799 | </form> |
@@ -4,18 +4,18 @@ |
||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | switch($modx->manager->action) { |
| 7 | - case 12: |
|
| 8 | - if(!$modx->hasPermission('edit_user')) { |
|
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | - } |
|
| 11 | - break; |
|
| 12 | - case 11: |
|
| 13 | - if(!$modx->hasPermission('new_user')) { |
|
| 14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | - } |
|
| 16 | - break; |
|
| 17 | - default: |
|
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | + case 12: |
|
| 8 | + if(!$modx->hasPermission('edit_user')) { |
|
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | + } |
|
| 11 | + break; |
|
| 12 | + case 11: |
|
| 13 | + if(!$modx->hasPermission('new_user')) { |
|
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | + } |
|
| 16 | + break; |
|
| 17 | + default: |
|
| 18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -switch($modx->manager->action) { |
|
| 6 | +switch ($modx->manager->action) { |
|
| 7 | 7 | case 12: |
| 8 | - if(!$modx->hasPermission('edit_user')) { |
|
| 8 | + if (!$modx->hasPermission('edit_user')) { |
|
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 10 | 10 | } |
| 11 | 11 | break; |
| 12 | 12 | case 11: |
| 13 | - if(!$modx->hasPermission('new_user')) { |
|
| 13 | + if (!$modx->hasPermission('new_user')) { |
|
| 14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 15 | 15 | } |
| 16 | 16 | break; |
@@ -18,20 +18,20 @@ discard block |
||
| 18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 21 | +$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 22 | 22 | |
| 23 | 23 | // check to see the snippet editor isn't locked |
| 24 | -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
| 25 | -if($username = $modx->db->getValue($rs)) { |
|
| 24 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
| 25 | +if ($username = $modx->db->getValue($rs)) { |
|
| 26 | 26 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
| 27 | 27 | } |
| 28 | 28 | // end check for lock |
| 29 | 29 | |
| 30 | -if($modx->manager->action == '12') { |
|
| 30 | +if ($modx->manager->action == '12') { |
|
| 31 | 31 | // get user attribute |
| 32 | 32 | $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
| 33 | 33 | $userdata = $modx->db->getRow($rs); |
| 34 | - if(!$userdata) { |
|
| 34 | + if (!$userdata) { |
|
| 35 | 35 | $modx->webAlertAndQuit("No user returned!"); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | // get user settings |
| 40 | 40 | $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
| 41 | 41 | $usersettings = array(); |
| 42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
| 42 | + while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
| 43 | 43 | // manually extract so that user display settings are not overwritten |
| 44 | - foreach($usersettings as $k => $v) { |
|
| 45 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
| 44 | + foreach ($usersettings as $k => $v) { |
|
| 45 | + if ($k != 'manager_language' && $k != 'manager_theme') { |
|
| 46 | 46 | ${$k} = $v; |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | // get user name |
| 51 | 51 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
| 52 | 52 | $usernamedata = $modx->db->getRow($rs); |
| 53 | - if(!$usernamedata) { |
|
| 53 | + if (!$usernamedata) { |
|
| 54 | 54 | $modx->webAlertAndQuit("No user returned while getting username!"); |
| 55 | 55 | } |
| 56 | 56 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // avoid doubling htmlspecialchars (already encoded in DB) |
| 65 | -foreach($userdata as $key => $val) { |
|
| 65 | +foreach ($userdata as $key => $val) { |
|
| 66 | 66 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
| 67 | 67 | }; |
| 68 | 68 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
| 69 | 69 | |
| 70 | 70 | // restore saved form |
| 71 | 71 | $formRestored = false; |
| 72 | -if($modx->manager->hasFormValues()) { |
|
| 72 | +if ($modx->manager->hasFormValues()) { |
|
| 73 | 73 | $modx->manager->loadFormValues(); |
| 74 | 74 | // restore post values |
| 75 | 75 | $userdata = array_merge($userdata, $_POST); |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | // include the country list language file |
| 85 | 85 | $_country_lang = array(); |
| 86 | 86 | include_once "lang/country/english_country.inc.php"; |
| 87 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
| 88 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
| 87 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
| 88 | + include_once "lang/country/".$manager_language."_country.inc.php"; |
|
| 89 | 89 | } |
| 90 | 90 | asort($_country_lang); |
| 91 | 91 | |
| 92 | 92 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
| 93 | -if($which_browser == 'default') { |
|
| 93 | +if ($which_browser == 'default') { |
|
| 94 | 94 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
| 95 | 95 | } |
| 96 | 96 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | document.userform.save.click(); |
| 183 | 183 | }, |
| 184 | 184 | delete: function() { |
| 185 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
| 185 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
| 186 | 186 | alert("<?php echo $_lang['alert_delete_self']; ?>"); |
| 187 | 187 | <?php } else { ?> |
| 188 | 188 | if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
| 206 | 206 | "id" => $user |
| 207 | 207 | )); |
| 208 | - if(is_array($evtOut)) { |
|
| 208 | + if (is_array($evtOut)) { |
|
| 209 | 209 | echo implode("", $evtOut); |
| 210 | 210 | } |
| 211 | 211 | ?> |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
| 215 | 215 | |
| 216 | 216 | <h1> |
| 217 | - <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?> |
|
| 217 | + <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?> |
|
| 218 | 218 | </h1> |
| 219 | 219 | |
| 220 | 220 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> |
@@ -232,13 +232,13 @@ discard block |
||
| 232 | 232 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
| 233 | 233 | <tr> |
| 234 | 234 | <td colspan="3"><span id="blocked" class="warning"> |
| 235 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
| 235 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
| 236 | 236 | <?php echo $_lang['user_is_blocked']; ?> |
| 237 | 237 | <?php } ?> |
| 238 | 238 | </span> |
| 239 | 239 | <br /></td> |
| 240 | 240 | </tr> |
| 241 | - <?php if(!empty($userdata['id'])) { ?> |
|
| 241 | + <?php if (!empty($userdata['id'])) { ?> |
|
| 242 | 242 | <tr id="showname" style="display: <?php echo ($modx->manager->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
| 243 | 243 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> |
| 244 | 244 | <input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
| 252 | 252 | </tr> |
| 253 | 253 | <tr> |
| 254 | - <th><?php echo $modx->manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
| 254 | + <th><?php echo $modx->manager->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
| 255 | 255 | <td> </td> |
| 256 | 256 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "11" ? " checked disabled" : ""; ?>> |
| 257 | 257 | <input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -305,8 +305,8 @@ discard block |
||
| 305 | 305 | ?> |
| 306 | 306 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
| 307 | 307 | <?php |
| 308 | - while($row = $modx->db->getRow($rs)) { |
|
| 309 | - if($modx->manager->action == '11') { |
|
| 308 | + while ($row = $modx->db->getRow($rs)) { |
|
| 309 | + if ($modx->manager->action == '11') { |
|
| 310 | 310 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
| 311 | 311 | } else { |
| 312 | 312 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
@@ -360,8 +360,8 @@ discard block |
||
| 360 | 360 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
| 361 | 361 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
| 362 | 362 | <?php |
| 363 | - foreach($_country_lang as $key => $country) { |
|
| 364 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
| 363 | + foreach ($_country_lang as $key => $country) { |
|
| 364 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
| 365 | 365 | } |
| 366 | 366 | ?> |
| 367 | 367 | </select></td> |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | <td> </td> |
| 388 | 388 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars($userdata['comment']); ?></textarea></td> |
| 389 | 389 | </tr> |
| 390 | - <?php if($modx->manager->action == '12') { ?> |
|
| 390 | + <?php if ($modx->manager->action == '12') { ?> |
|
| 391 | 391 | <tr> |
| 392 | 392 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
| 393 | 393 | <td> </td> |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | </tr> |
| 425 | 425 | <?php } ?> |
| 426 | 426 | </table> |
| 427 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
| 427 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
| 428 | 428 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> |
| 429 | 429 | <?php } ?> |
| 430 | 430 | </div> |
@@ -441,8 +441,8 @@ discard block |
||
| 441 | 441 | <?php |
| 442 | 442 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
| 443 | 443 | $dir = dir("includes/lang"); |
| 444 | - while($file = $dir->read()) { |
|
| 445 | - if(strpos($file, ".inc.php") > 0) { |
|
| 444 | + while ($file = $dir->read()) { |
|
| 445 | + if (strpos($file, ".inc.php") > 0) { |
|
| 446 | 446 | $endpos = strpos($file, "."); |
| 447 | 447 | $languagename = substr($file, 0, $endpos); |
| 448 | 448 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -529,17 +529,17 @@ discard block |
||
| 529 | 529 | <option value=""></option> |
| 530 | 530 | <?php |
| 531 | 531 | $dir = dir("media/style/"); |
| 532 | - while($file = $dir->read()) { |
|
| 533 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
| 532 | + while ($file = $dir->read()) { |
|
| 533 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
| 534 | 534 | $themename = $file; |
| 535 | - if($themename === 'common') { |
|
| 535 | + if ($themename === 'common') { |
|
| 536 | 536 | continue; |
| 537 | 537 | } |
| 538 | - $attr = 'value="' . $themename . '" '; |
|
| 539 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
| 538 | + $attr = 'value="'.$themename.'" '; |
|
| 539 | + if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
| 540 | 540 | $attr .= 'selected="selected" '; |
| 541 | 541 | } |
| 542 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
| 542 | + echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n"; |
|
| 543 | 543 | } |
| 544 | 544 | } |
| 545 | 545 | $dir->close(); |
@@ -580,12 +580,12 @@ discard block |
||
| 580 | 580 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
| 581 | 581 | <?php |
| 582 | 582 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
| 583 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
| 584 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
| 583 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; |
|
| 584 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
| 585 | 585 | $dir = str_replace('\\', '/', $dir); |
| 586 | 586 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
| 587 | 587 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
| 588 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
| 588 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n"; |
|
| 589 | 589 | } |
| 590 | 590 | ?> |
| 591 | 591 | </select></td> |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | </tr> |
| 613 | 613 | <tr> |
| 614 | 614 | <td> </td> |
| 615 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> |
|
| 615 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> |
|
| 616 | 616 | </tr> |
| 617 | 617 | <tr> |
| 618 | 618 | <th><?php echo $_lang["uploadable_media_title"] ?></th> |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | </tr> |
| 625 | 625 | <tr> |
| 626 | 626 | <td> </td> |
| 627 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> |
|
| 627 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> |
|
| 628 | 628 | </tr> |
| 629 | 629 | <tr> |
| 630 | 630 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | </tr> |
| 637 | 637 | <tr> |
| 638 | 638 | <td> </td> |
| 639 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> |
|
| 639 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> |
|
| 640 | 640 | </tr> |
| 641 | 641 | <tr> |
| 642 | 642 | <th><?php echo $_lang["uploadable_files_title"] ?></th> |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | </tr> |
| 649 | 649 | <tr> |
| 650 | 650 | <td> </td> |
| 651 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> |
|
| 651 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> |
|
| 652 | 652 | </tr> |
| 653 | 653 | <tr class='row2'> |
| 654 | 654 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> |
@@ -667,11 +667,11 @@ discard block |
||
| 667 | 667 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
| 668 | 668 | // invoke OnRichTextEditorRegister event |
| 669 | 669 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
| 670 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
| 671 | - if(is_array($evtOut)) { |
|
| 672 | - for($i = 0; $i < count($evtOut); $i++) { |
|
| 670 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; |
|
| 671 | + if (is_array($evtOut)) { |
|
| 672 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
| 673 | 673 | $editor = $evtOut[$i]; |
| 674 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
| 674 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
| 675 | 675 | } |
| 676 | 676 | } |
| 677 | 677 | ?> |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | <?php |
| 710 | 710 | // invoke OnInterfaceSettingsRender event |
| 711 | 711 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
| 712 | - if(is_array($evtOut)) { |
|
| 712 | + if (is_array($evtOut)) { |
|
| 713 | 713 | echo implode("", $evtOut); |
| 714 | 714 | } |
| 715 | 715 | ?> |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | function BrowseServer() { |
| 737 | 737 | var w = screen.width * 0.7; |
| 738 | 738 | var h = screen.height * 0.7; |
| 739 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
| 739 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
| 740 | 740 | } |
| 741 | 741 | |
| 742 | 742 | function SetUrl(url, width, height, alt) { |
@@ -759,17 +759,17 @@ discard block |
||
| 759 | 759 | </tr> |
| 760 | 760 | </table> |
| 761 | 761 | </div> |
| 762 | - <?php if($use_udperms == 1) { |
|
| 762 | + <?php if ($use_udperms == 1) { |
|
| 763 | 763 | |
| 764 | 764 | $groupsarray = array(); |
| 765 | 765 | |
| 766 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
| 766 | + if ($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
| 767 | 767 | $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
| 768 | 768 | $groupsarray = $modx->db->getColumn('user_group', $rs); |
| 769 | 769 | } |
| 770 | 770 | // retain selected doc groups between post |
| 771 | - if(is_array($_POST['user_groups'])) { |
|
| 772 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 771 | + if (is_array($_POST['user_groups'])) { |
|
| 772 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 773 | 773 | } |
| 774 | 774 | ?> |
| 775 | 775 | <div class="tab-page" id="tabAccess"> |
@@ -778,8 +778,8 @@ discard block |
||
| 778 | 778 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
| 779 | 779 | <?php |
| 780 | 780 | $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
| 781 | - while($row = $modx->db->getRow($rs)) { |
|
| 782 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
| 781 | + while ($row = $modx->db->getRow($rs)) { |
|
| 782 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; |
|
| 783 | 783 | } |
| 784 | 784 | } |
| 785 | 785 | ?> |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
| 793 | 793 | "id" => $user |
| 794 | 794 | )); |
| 795 | - if(is_array($evtOut)) { |
|
| 795 | + if (is_array($evtOut)) { |
|
| 796 | 796 | echo implode("", $evtOut); |
| 797 | 797 | } |
| 798 | 798 | ?> |
@@ -39,7 +39,9 @@ discard block |
||
| 39 | 39 | // get user settings |
| 40 | 40 | $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
| 41 | 41 | $usersettings = array(); |
| 42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
| 42 | + while($row = $modx->db->getRow($rs)) { |
|
| 43 | + $usersettings[$row['setting_name']] = $row['setting_value']; |
|
| 44 | + } |
|
| 43 | 45 | // manually extract so that user display settings are not overwritten |
| 44 | 46 | foreach($usersettings as $k => $v) { |
| 45 | 47 | if($k != 'manager_language' && $k != 'manager_theme') { |
@@ -763,13 +765,16 @@ discard block |
||
| 763 | 765 | |
| 764 | 766 | $groupsarray = array(); |
| 765 | 767 | |
| 766 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
| 768 | + if($modx->manager->action == '12') { |
|
| 769 | +// only do this bit if the user is being edited |
|
| 767 | 770 | $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
| 768 | 771 | $groupsarray = $modx->db->getColumn('user_group', $rs); |
| 769 | 772 | } |
| 770 | 773 | // retain selected doc groups between post |
| 771 | 774 | if(is_array($_POST['user_groups'])) { |
| 772 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 775 | + foreach($_POST['user_groups'] as $n => $v) { |
|
| 776 | + $groupsarray[] = $v; |
|
| 777 | + } |
|
| 773 | 778 | } |
| 774 | 779 | ?> |
| 775 | 780 | <div class="tab-page" id="tabAccess"> |