本文整理汇总了PHP中AUTH::setpwd方法的典型用法代码示例。如果您正苦于以下问题:PHP AUTH::setpwd方法的具体用法?PHP AUTH::setpwd怎么用?PHP AUTH::setpwd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AUTH
的用法示例。
在下文中一共展示了AUTH::setpwd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
if (is_array($info)) {
while ($k = key($info)) {
$tpl['info_' . $k] = $info[$k];
next($info);
}
}
$app->render('profile.html', $tpl);
});
$app->post('/ajax_save_pwd', function () use($app) {
$post = $app->request()->post();
$auth = new AUTH($_SESSION['auth_uid']);
if ($auth->login($post['old_pwd'])) {
if ($post['new_pwd'] != $post['confirm_pwd']) {
$msg = array('class' => 'error', 'msg' => '兩次輸入的密碼不同');
} else {
$rt = $auth->setpwd($post['new_pwd']);
if ($rt) {
$msg = array('class' => 'success', 'msg' => '變更密碼完成');
} else {
$msg = array('class' => 'error', 'msg' => '變更失敗');
}
}
} else {
$msg = array('class' => 'error', 'msg' => '舊密碼錯誤');
}
$app->render('_notice.html', $msg);
});
$app->post('/ajax_save_info', function () use($app) {
$post = $app->request()->post();
$data = array('name' => $post['info_name'], 'phone' => $post['info_phone'], 'email' => $post['info_email']);
$user = ORM::for_table('account')->where('acc_name', $_SESSION['auth_uid'])->find_one();
示例2: array
}
if ($post['account_type'] == 'db') {
if ($post['account_pwd'] != $post['account_pwd2']) {
$msg = array('class' => 'error', 'msg' => '兩次輸入的密碼不同');
}
}
if ($msg == '') {
$company = serialize(array('name' => $post['account_name'], 'phone' => $post['account_phone'], 'email' => $post['account_email']));
$acc = ORM::for_table('account')->where('acc_name', $post['account_id'])->find_one();
$acc->acc_auth_type = $post['account_type'];
$acc->acc_flag = $post['account_flag'];
$acc->acc_company = $company;
$acc->save();
if ($post['account_type'] == 'db' && $post['account_pwd'] != '') {
$auth = new AUTH($post['account_id']);
$auth->setpwd($post['account_pwd']);
}
$msg = array('class' => 'success', 'msg' => '帳號修改完成');
}
$app->render('_notice.html', $msg);
});
/*
* 刪除
*/
$app->get('/user_delete/:id', function ($id) use($app) {
$app->applyHook('account.check_sysadmin');
$type_words = AUTH::get_support_auth_type();
$tpl = array('breadcrumb_title' => '刪除帳號', 'type_words' => $type_words);
$user = ORM::for_table('account')->where('acc_name', $id)->find_one();
$tpl['acc_name'] = $user->acc_name;
$tpl['acc_auth_type'] = $user->acc_auth_type;