mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-22 10:56:31 +00:00
Users: Revamp and consolidate code, integrate ORM.
This commit is contained in:
@@ -60,29 +60,6 @@ if ($domains_processed == 1) {
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
||||
//if user_enabled is null then set to enabled true
|
||||
$sql = "select count(*) as count from v_users ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and user_enabled is null ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$sub_result = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
unset ($prep_statement);
|
||||
if ($sub_result['count'] > 0) {
|
||||
//begin the transaction
|
||||
$db->beginTransaction();
|
||||
//send output
|
||||
if ($display_type == "text") {
|
||||
echo " Users: set enabled=true\n";
|
||||
}
|
||||
//set the user_enabled to true
|
||||
$sql = "update v_users set ";
|
||||
$sql .= "user_enabled = 'true' ";
|
||||
$db->exec($sql);
|
||||
unset($sql);
|
||||
//end the transaction
|
||||
$db->commit();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user