Users: Revamp and consolidate code, integrate ORM.

This commit is contained in:
reliberate
2016-10-05 10:29:30 -06:00
parent d98bac68a6
commit d20a495548
32 changed files with 2613 additions and 2342 deletions

View File

@@ -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();
}
}
?>