X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fadmin.php;h=c9ff23e2d84c9e1899c0031d25e8585e2f60e3d3;hb=789e1f4275bb216183f93cc392bd6faebfe87fb9;hp=4ae921b04830c714190eb45a713d8dda9d5fc1d3;hpb=30b93b74dbd3a39e0296ee6ed43a0322e1e59e44;p=friendica.git diff --git a/mod/admin.php b/mod/admin.php index 4ae921b048..c9ff23e2d8 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -460,6 +460,7 @@ function admin_page_summary(&$a) { '$title' => t('Administration'), '$page' => t('Summary'), '$queues' => $queues, + '$workeractive' => get_config('system','worker'), '$users' => array(t('Registered users'), $users), '$accounts' => $accounts, '$pending' => array(t('Pending registrations'), $pending), @@ -1126,18 +1127,20 @@ function admin_page_dbsync(&$a) { * @param App $a */ function admin_page_users_post(&$a){ - $pending = (x($_POST, 'pending') ? $_POST['pending'] : array()); - $users = (x($_POST, 'user') ? $_POST['user'] : array()); - $nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : ''); - $nu_nickname = (x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : ''); - $nu_email = (x($_POST, 'new_user_email') ? $_POST['new_user_email'] : ''); + $pending = (x($_POST, 'pending') ? $_POST['pending'] : array()); + $users = (x($_POST, 'user') ? $_POST['user'] : array()); + $nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : ''); + $nu_nickname = (x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : ''); + $nu_email = (x($_POST, 'new_user_email') ? $_POST['new_user_email'] : ''); + $nu_language = get_config('system', 'language'); check_form_security_token_redirectOnErr('/admin/users', 'admin_users'); if(!($nu_name==="") && !($nu_email==="") && !($nu_nickname==="")) { require_once('include/user.php'); - $result = create_user(array('username'=>$nu_name, 'email'=>$nu_email, 'nickname'=>$nu_nickname, 'verified'=>1)); + $result = create_user(array('username'=>$nu_name, 'email'=>$nu_email, + 'nickname'=>$nu_nickname, 'verified'=>1, 'language'=>$nu_language)); if(! $result['success']) { notice($result['message']); return; @@ -1276,14 +1279,14 @@ function admin_page_users(&$a){ /* ordering */ $valid_orders = array( - 'contact.name', + 'contact.name', 'user.email', 'user.register_date', 'user.login_date', - 'lastitem.lastitem_date', + 'lastitem_date', 'user.page-flags' ); - + $order = "contact.name"; $order_direction = "+"; if (x($_GET,'o')){ @@ -1292,38 +1295,29 @@ function admin_page_users(&$a){ $order_direction = "-"; $new_order = substr($new_order,1); } - + if (in_array($new_order, $valid_orders)){ $order = $new_order; } if (x($_GET,'d')){ $new_direction = $_GET['d']; - } } $sql_order = "`".str_replace('.','`.`',$order)."`"; $sql_order_direction = ($order_direction==="+")?"ASC":"DESC"; - - $users = q("SELECT `user`.* , `contact`.`name` , `contact`.`url` , `contact`.`micro`, `lastitem`.`lastitem_date`, `user`.`account_expired` - FROM - (SELECT MAX(`item`.`changed`) as `lastitem_date`, `item`.`uid` - FROM `item` - WHERE `item`.`type` = 'wall' - GROUP BY `item`.`uid`) AS `lastitem` - RIGHT OUTER JOIN `user` ON `user`.`uid` = `lastitem`.`uid`, - `contact` - WHERE - `user`.`uid` = `contact`.`uid` - AND `user`.`verified` =1 - AND `contact`.`self` =1 - ORDER BY $sql_order $sql_order_direction LIMIT %d, %d - ", + + $users = q("SELECT `user`.*, `contact`.`name`, `contact`.`url`, `contact`.`micro`, `user`.`account_expired`, + (SELECT MAX(`changed`) FROM `item` FORCE INDEX (`uid_wall_changed`) WHERE `wall` AND `uid` = `user`.`uid`) AS `lastitem_date` + FROM `user` + INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self` + WHERE `user`.`verified` + ORDER BY $sql_order $sql_order_direction LIMIT %d, %d", intval($a->pager['start']), intval($a->pager['itemspage']) ); - + //echo "
$users"; killme();
-				
+
 	$adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
 	$_setup_users = function ($e) use ($adminlist){
 		$accounts = array(
@@ -1867,6 +1861,12 @@ function admin_page_logs(&$a){
 		LOGGER_DATA	=> 'Data',
 		LOGGER_ALL	=> 'All'
 	);
+	
+	if (ini_get('log_errors')) {
+		$phplogenabled = t('PHP log currently enabled.');
+	} else {
+		$phplogenabled = t('PHP log currently disabled.');
+	}
 
 	$t = get_markup_template("admin_logs.tpl");
 
@@ -1887,6 +1887,7 @@ function admin_page_logs(&$a){
 		'$phpheader' => t("PHP logging"),
 		'$phphint' => t("To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."),
 		'$phplogcode' => "error_reporting(E_ERROR | E_WARNING | E_PARSE);\nini_set('error_log','php.out');\nini_set('log_errors','1');\nini_set('display_errors', '1');",
+		'$phplogenabled' => $phplogenabled,
 	));
 }