Esempio n. 1
0
         if (($rights & ~(ALBUM_RIGHTS | ZENPAGE_PAGES_RIGHTS | ZENPAGE_NEWS_RIGHTS)) != $oldrights) {
             $userobj->setRights($rights | NO_RIGHTS);
             markUpdated();
         }
         if ($objects != $oldobjects) {
             $userobj->setObjects($objects);
             markUpdated();
         }
     } else {
         $oldobjects = $userobj->setObjects(NULL);
         // indicates no change
     }
     $updated = zp_apply_filter('save_admin_custom_data', $updated, $userobj, $i, $alter);
     if (isset($_POST['createAlbum_' . $i])) {
         $userobj->createPrimealbum();
         markUpdated();
     }
     if ($updated) {
         $returntab .= '&show[]=' . $user;
         $msg = zp_apply_filter('save_user', $msg, $userobj, $what);
         if (empty($msg)) {
             if (!$notify) {
                 $userobj->transient = false;
             }
             $userobj->save();
         } else {
             $notify = '?mismatch=format&error=' . urlencode($msg);
             $error = true;
         }
     }
 }
Esempio n. 2
0
    $master_note = (string) db_result00($sql);
}
$sql = "UPDATE " . PREF . "users\n\tSET name='{$name}',\n\t\tnick='{$nick}',\n\t\tcity='{$city}',\n\t\tage='{$age}',\n\t\tcontacts='{$contacts}',\n\t\tcontraindication='{$contraindication}',\n\t\tchronicdesease='{$chronicdesease}',\n\t\twishes='{$wishes}',\n\t\tpublicity='{$publicity}',\n\t\tcharacter_name='{$character_name}',\n\t\tcharacter_age='{$character_age}',\n\t\tcountry='{$country}',\n\t\tbirth='{$birth}',\n\t\trank='{$rank}',\n\t\tquota='{$quota}',\n\t\tquenta='{$quenta}',\n\t\twishes2='{$wishes2}',\n\t\tmaster_note='{$master_note}',\n\t\tgo_royal_wedding={$go_royal_wedding}\n\n\tWHERE id={$userid}\n\tLIMIT 1";
query($sql);
$updated = (bool) affected_rows();
if (isset($_FILES["photo"]) && $_FILES["photo"]['error'] != 4) {
    $options = new FileUploadOptions();
    $options->key = "photo";
    $options->extensions = ["png", "jpg", "jpeg", "gif"];
    $options->dir = "../photos/";
    $options->is_critical = true;
    $options->neoname = photoFileName($email) . ".jpg";
    if (file_exists("../photos/{$options->neoname}")) {
        unlink("../photos/{$options->neoname}");
    }
    $filename = file_upload($options);
    if ($filename != $options->neoname) {
        rename("../photos/" . $filename, "../photos/" . $options->neoname);
    }
    $updated = true;
}
if ($updated) {
    $link = $_SERVER["HTTP_HOST"] . "/edit.php?" . http_build_query(["email" => $email]);
    if ($editorid == emailToId($email)) {
        markUpdated(emailToId($email));
        // send_mail_to_admin("$name обновил заявку", "<a href=\"$link\">Просмотреть</a>");
    } else {
        send_mail_by_userid(emailToId($email), "Мастер отредактировал вашу заявку", "<a href=\"{$link}\">Просмотреть</a>");
    }
}
redirect(isAdmin($editorid) ? "/table.php#{$email}" : "/edit.php?" . http_build_query(["email" => idToEmail($editorid), "justUpdated" => true]));