more register_approve stuff - like the admin page. Hopefully this won't conflict with Thomas's admin page "list users" changes
This commit is contained in:
parent
07e0ffd7c7
commit
62afdf3820
1
boot.php
1
boot.php
@ -363,6 +363,7 @@ define ( 'ACCOUNT_UNVERIFIED', 0x0001 );
|
|||||||
define ( 'ACCOUNT_BLOCKED', 0x0002 );
|
define ( 'ACCOUNT_BLOCKED', 0x0002 );
|
||||||
define ( 'ACCOUNT_EXPIRED', 0x0004 );
|
define ( 'ACCOUNT_EXPIRED', 0x0004 );
|
||||||
define ( 'ACCOUNT_REMOVED', 0x0008 );
|
define ( 'ACCOUNT_REMOVED', 0x0008 );
|
||||||
|
define ( 'ACCOUNT_PENDING', 0x0010 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Account roles
|
* Account roles
|
||||||
|
@ -317,6 +317,11 @@ function user_allow($hash) {
|
|||||||
intval(ACCOUNT_BLOCKED),
|
intval(ACCOUNT_BLOCKED),
|
||||||
intval($register[0]['uid'])
|
intval($register[0]['uid'])
|
||||||
);
|
);
|
||||||
|
$r = q("update account set account_flags = (account_flags ^ %d) where (account_flags & %d) and account_id = %d limit 1",
|
||||||
|
intval(ACCOUNT_PENDING),
|
||||||
|
intval(ACCOUNT_PENDING),
|
||||||
|
intval($register[0]['uid'])
|
||||||
|
);
|
||||||
|
|
||||||
$r = q("SELECT uid FROM profile WHERE uid = %d AND is_default = 1",
|
$r = q("SELECT uid FROM profile WHERE uid = %d AND is_default = 1",
|
||||||
intval($account[0]['account_id'])
|
intval($account[0]['account_id'])
|
||||||
|
@ -496,13 +496,13 @@ function admin_page_users_post(&$a){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (x($_POST,'page_users_approve')){
|
if (x($_POST,'page_users_approve')){
|
||||||
require_once("mod/regmod.php");
|
require_once('include/account.php');
|
||||||
foreach($pending as $hash){
|
foreach($pending as $hash){
|
||||||
user_allow($hash);
|
user_allow($hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (x($_POST,'page_users_deny')){
|
if (x($_POST,'page_users_deny')){
|
||||||
require_once("mod/regmod.php");
|
require_once('include/account.php');
|
||||||
foreach($pending as $hash){
|
foreach($pending as $hash){
|
||||||
user_deny($hash);
|
user_deny($hash);
|
||||||
}
|
}
|
||||||
@ -552,11 +552,9 @@ function admin_page_users(&$a){
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get pending */
|
/* get pending */
|
||||||
$pending = q("SELECT `register`.*, `contact`.`name`, `user`.`email`
|
$pending = q("SELECT * from account where (account_flags & %d ) ",
|
||||||
FROM `register`
|
intval(ACCOUNT_PENDING)
|
||||||
LEFT JOIN `contact` ON `register`.`uid` = `contact`.`uid`
|
);
|
||||||
LEFT JOIN `user` ON `register`.`uid` = `user`.`uid`;");
|
|
||||||
|
|
||||||
|
|
||||||
/* get users */
|
/* get users */
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ function register_post(&$a) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case REGISTER_APPROVE:
|
case REGISTER_APPROVE:
|
||||||
$flags = ACCOUNT_UNVERIFIED | ACCOUNT_BLOCKED;
|
$flags = ACCOUNT_UNVERIFIED | ACCOUNT_BLOCKED | ACCOUNT_PENDING;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user