Exemple #1
0
         flash();
     } else {
         flash("success", "adminer.php?do=admingroup");
     }
 }
 if (!empty($_POST['data']['adminfield'])) {
     $vals = $_POST['data']['adminfield'];
     if ($_POST['auth'] == 1) {
         if (!empty($_POST['priv']) && is_array($_POST['priv'])) {
             $vals['permissions'] = implode(",", $_POST['priv']);
         }
     } else {
         $vals['permissions'] = '';
     }
     if (!empty($_POST['data']['adminer']['user_pass'])) {
         $vals['user_pass'] = $member->authPasswd($_POST['data']['adminer']['user_pass']);
     }
     $adminer->primaryKey = "member_id";
     if (!empty($_POST['data']['expired'])) {
         include LIB_PATH . "time.class.php";
         $vals['expired'] = Times::dateConvert($_POST['data']['expired']);
     }
     if (!empty($_POST['member_id'])) {
         $member_id = intval($_POST['member_id']);
         $member->save($_POST['data']['member'], "update", $member_id);
         //update role
         $result = $adminer->save($vals, "update", $member_id);
         if (!$pdb->Execute("UPDATE {$tb_prefix}roleadminers SET adminrole_id='" . $_POST['data']['adminrole_id'] . "' WHERE adminer_id='" . $member_id . "'")) {
             $pdb->Execute("INSERT INTO {$tb_prefix}roleadminers (adminrole_id,adminer_id) VALUES ('" . $_POST['data']['adminrole_id'] . "','" . $member_id . "')");
         }
     } else {
Exemple #2
0
    }
    $result = $pdb->Execute($sql);
    if (!$result) {
        flash();
    }
}
if (isset($_POST['save'])) {
    if (isset($_POST['id'])) {
        $member_id = $_POST['id'];
    }
    $vals = $_POST['data']['member'];
    if (!empty($_POST['data']['userpass'])) {
        if (!pb_strcomp($_POST['data']['userpass'], $_POST['data']['re_userpass'])) {
            flash("invalid_password");
        } else {
            $vals['userpass'] = $member->authPasswd($_POST['data']['userpass']);
        }
    }
    if (!empty($_POST['data']['trusttype'])) {
        $vals['trusttype_ids'] = implode(",", $_POST['data']['trusttype']);
    }
    if (isset($_POST['data']['service_start_date'])) {
        $vals['service_start_date'] = Times::dateConvert($_POST['data']['service_start_date']);
    }
    if (isset($_POST['data']['service_end_date'])) {
        $vals['service_end_date'] = Times::dateConvert($_POST['data']['service_end_date']);
    }
    if (!empty($member_id)) {
        $vals['modified'] = $time_stamp;
        if (!empty($vals['space_name'])) {
            $member->updateSpaceName(array('id' => $member_id), $vals['space_name']);
Exemple #3
0
require "share.inc.php";
require "libraries/sendmail.inc.php";
uses("member");
$member = new Members();
if (isset($_POST['do'])) {
    pb_submit_check('data');
    $do = trim($_POST['do']);
    if ($do == "reset") {
        $username = trim($_POST['data']['username']);
        $userpass = trim($_POST['data']['password1']);
        if (!empty($userpass) && !empty($username)) {
            $user_exists = $member->checkUserExist($username, true);
            if (!$user_exists) {
                flash("member_not_exists");
            } else {
                $result = $pdb->Execute("UPDATE {$tb_prefix}members SET userpass='******' WHERE id=" . $member->info['id'] . " AND status='1'");
                if ($result) {
                    flash("reset_and_login", "logging.php");
                }
            }
        }
    }
}
if (isset($_POST['action'])) {
    pb_submit_check("data");
    $checked = true;
    $login_name = trim($_POST['data']['username']);
    $user_email = trim($_POST['data']['email']);
    if (!pb_check_email($user_email)) {
        setvar("ERRORS", L("wrong_email_format"));
        $checked = false;