if (!empty($checkresults)) {
        cpmsg('modifypasswd_error', '', 'error', '', true, true, $checkresults);
    }
    require_once B_ROOT . './uc_client/client.php';
    $ucresult = uc_user_edit($_G['username'], $_POST['password'], $_POST['newpassword1']);
    if ($ucresult == -1) {
        array_push($checkresults, array('password' => $lang['old_password_invalid']));
    } elseif ($ucresult == -7) {
        array_push($checkresults, array('message' => $lang['no_change']));
    } elseif ($ucresult == -8) {
        array_push($checkresults, array('message' => $lang['protection_of_users']));
    }
    if (!empty($checkresults)) {
        cpmsg('modifypasswd_error', '', 'error', '', true, true, $checkresults);
    }
    sclearcookie();
    cpmsg('getpasswd_succeed', 'index.php', 'succeed');
}
shownav('shop', 'nav_modifypasswd');
showsubmenu('nav_modifypasswd');
showtips('modifypasswd_list_tips');
showformheader('modifypasswd');
showtableheader('');
$required = '<span style="color:red">*</span>';
showsetting('modifypasswd_passwd', 'password', '', 'password', '', '', '', '', $required);
showsetting('modifypasswd_newpasswd1', 'newpassword1', '', 'password', '', '', '', '', $required);
showsetting('modifypasswd_newpasswd2', 'newpassword2', '', 'password', '', '', '', '', $required);
showsubmit('valuesubmit');
showtablefooter();
showformfooter();
bind_ajax_form();
Beispiel #2
0
function getmember()
{
    global $_SGLOBAL, $_SC;
    $_SGLOBAL['supe_uid'] = 0;
    $_SGLOBAL['supe_username'] = '';
    $_SGLOBAL['member'] = array();
    if ($_COOKIE[$_SC['cookiepre'] . 'auth']) {
        @(list($password, $uid) = explode("\t", authcode($_COOKIE[$_SC['cookiepre'] . 'auth'], 'DECODE')));
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('members') . " WHERE uid='" . intval($uid) . "' AND password='******'");
        if ($member = $_SGLOBAL['db']->fetch_array($query)) {
            $_SGLOBAL['member'] = $member;
            $_SGLOBAL['supe_uid'] = $member['uid'];
            $_SGLOBAL['supe_username'] = addslashes($member['username']);
        } else {
            sclearcookie();
        }
    }
}