39 return 'User Permissions Test';
52 return 'A test to check for invalid users on the permission table in Matrix';
66 public static function test(&$messages, &$errors)
70 $am = $GLOBALS[
'SQ_SYSTEM']->am;
71 $sql =
'SELECT DISTINCT userid FROM sq_ast_perm ORDER BY userid';
72 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db');
75 foreach ($assetids as $assetid) {
77 $asset = $am->getAsset($assetid,
'', TRUE);
78 if (is_null($asset)) {
81 $errors[] =
'User #'.$assetid.
' does not exist';
83 $am->forgetAsset($asset, TRUE);
88 if (!$status && !empty($count)) {
89 $messages[] =
'There are '.$count.
' users on the permissions table that do not exist';