Example #1
0
    if (!$delUser->delete()) {
        $Message = "Error: Could not remove user: "******"<strong>Added " . $_POST['perm'] . " permission for {$changedPerms} users</strong>";
        } else {
            if ($_POST['remove_perm']) {
                $Message = "<strong>Removed " . $_POST['perm'] . " permission for {$changedPerms} users</strong>";
            }
        }
Example #2
0
 $opUser->fax = $_POST["fax"];
 $PASS1 = $_POST["password1"];
 $PASS2 = $_POST["password2"];
 // set permissions without removing existing ones
 // (this way perms added from other systems are preserved)
 $opUser->sakaiPerm = array();
 // clear first
 if (is_array($_POST["perms"])) {
     $perms_sql = "select perm_name from permissions";
     $perm_result = mysql_query($perms_sql) or die("Query failed ({$perms_sql}): " . mysql_error());
     while ($row = mysql_fetch_assoc($perm_result)) {
         $perm = $row['perm_name'];
         if (in_array($perm, $_POST["perms"])) {
             $opUser->addPerm($perm);
         } else {
             $opUser->removePerm($perm);
         }
     }
 }
 if ($_POST["active"]) {
     $opUser->addStatus("active");
 } else {
     $opUser->removeStatus("active");
 }
 // DO SERVER SIDE VALIDATION
 $errors = 0;
 $validationOutput = ServerValidate($vItems, "return");
 if ($validationOutput) {
     $errors++;
     $Message = "<fieldset><legend>Validation Errors</legend>" . "<span style='color:red;'>Please fix the following errors:</span><br/>" . $validationOutput . "</fieldset>";
     $MessageColor = "#FF0000";