aboutsummaryrefslogtreecommitdiffstats
path: root/mod/admin.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-07-05 07:11:57 +0200
committerfabrixxm <fabrix.xm@gmail.com>2011-07-05 07:11:57 +0200
commit4e7a5dc56ebb8d99ed06b0b303c4ee24460ae6a8 (patch)
tree84184bd3aa80c896b8dceaf5a017297c7267f2cb /mod/admin.php
parentcfd59f6ac8848c19a0c451c378d2b770cafcbef0 (diff)
parent2359783b9f6c0ec754c641453026712cf22e7cb6 (diff)
downloadvolse-hubzilla-4e7a5dc56ebb8d99ed06b0b303c4ee24460ae6a8.tar.gz
volse-hubzilla-4e7a5dc56ebb8d99ed06b0b303c4ee24460ae6a8.tar.bz2
volse-hubzilla-4e7a5dc56ebb8d99ed06b0b303c4ee24460ae6a8.zip
Merge branch 'dispy' of github.com:fabrixxm/friendika into dispy
Diffstat (limited to 'mod/admin.php')
-rw-r--r--mod/admin.php33
1 files changed, 15 insertions, 18 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 920adf05d..8f0b2c93d 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -327,11 +327,8 @@ function admin_page_site(&$a) {
* Users admin page
*/
function admin_page_users_post(&$a){
- $users=array(); $pending=array();
- foreach($_POST as $k=>$v){
- if (substr($k,0,5)=="user_") $users[] = substr($k,5,strlen($k)-5);
- if (substr($k,0,8)=="pending_") $users[] = substr($k,8,strlen($k)-8);
- }
+ $pending = ( x(£_POST, 'pending') ? $_POST['pending'] : Array() );
+ $users = ( x($_POST, 'user') ? $_POST['user'] : Array() );
if (x($_POST,'page_users_block')){
foreach($users as $uid){
@@ -350,13 +347,13 @@ function admin_page_users_post(&$a){
}
if (x($_POST,'page_users_approve')){
- require_once("include/regmod.php");
+ require_once("mod/regmod.php");
foreach($pending as $hash){
user_allow($hash);
}
}
if (x($_POST,'page_users_deny')){
- require_once("include/regmod.php");
+ require_once("mod/regmod.php");
foreach($pending as $hash){
user_deny($hash);
}
@@ -409,22 +406,22 @@ function admin_page_users(&$a){
$a->set_pager_itemspage(100);
}
- $users = q("SELECT `user` . * , `contact`.`name` , `contact`.`url` , `contact`.`micro` , `lastitem`.`lastitem_date`
- FROM (
- SELECT MAX(`item`.`changed`) as `lastitem_date`, `item`.`uid`
+ $users = q("SELECT `user` . * , `contact`.`name` , `contact`.`url` , `contact`.`micro`, `lastitem`.`lastitem_date`
+ FROM
+ (SELECT MAX(`item`.`changed`) as `lastitem_date`, `item`.`uid`
FROM `item`
WHERE `item`.`type` = 'wall'
- GROUP BY `item`.`uid`
- ) AS `lastitem` , `user`
- LEFT JOIN `contact` ON `user`.`uid` = `contact`.`uid`
- WHERE `user`.`verified` =1
- AND `contact`.`self` =1
- AND `lastitem`.`uid` = `user`.`uid`
+ 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 `contact`.`name` LIMIT %d, %d
",
intval($a->pager['start']),
intval($a->pager['itemspage'])
-
);
function _setup_users($e){
@@ -459,7 +456,7 @@ function admin_page_users(&$a){
'$unblock' => t('Unblock'),
'$h_users' => t('Users'),
- '$th_users' => array( t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account') ),
+ '$th_users' => array( t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account') ),
'$confirm_delete_multi' => t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),