本文整理汇总了PHP中CUser::getError方法的典型用法代码示例。如果您正苦于以下问题:PHP CUser::getError方法的具体用法?PHP CUser::getError怎么用?PHP CUser::getError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::getError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
<?php
/* ADMIN $Id: do_user_aed.php,v 1.13 2005/03/11 00:46:46 gregorerhardt Exp $ */
include $AppUI->getModuleClass('contacts');
$del = isset($_REQUEST['del']) ? $_REQUEST['del'] : FALSE;
$obj = new CUser();
$contact = new CContact();
if (!$obj->bind($_POST)) {
$AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
if (!$contact->bind($_POST)) {
$AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('User');
// !User's contact information not deleted - left for history.
if ($del) {
if ($msg = $obj->delete()) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
$AppUI->redirect();
} else {
$AppUI->setMsg("deleted", UI_MSG_ALERT, true);
$AppUI->redirect('', -1);
}
return;
}
$isNewUser = !$_REQUEST['user_id'];
if ($isNewUser) {
// check if a user with the param Username already exists
示例2: die
<?php
/* $Id: do_user_aed.php 1866 2011-05-01 06:20:10Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/tags/version2.4/modules/admin/do_user_aed.php $ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
$del = (int) w2PgetParam($_POST, 'del', 0);
$obj = new CUser();
if (!$obj->bind($_POST)) {
$AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
$contact = new CContact();
if (!$contact->bind($_POST)) {
$AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
$action = $del ? 'deleted' : 'stored';
$contact_id = (int) w2PgetParam($_POST, 'contact_id', 0);
$user_id = (int) w2PgetParam($_POST, 'user_id', 0);
$isNewUser = !$user_id;
$perms =& $AppUI->acl();
if ($del) {
} elseif ($isNewUser) {
if (!canAdd('admin')) {
$AppUI->redirect('m=public&a=access_denied');
}
if (!canAdd('users')) {
$AppUI->redirect('m=public&a=access_denied');
}
} else {
示例3: CDatabase
/**
* This is a Hera pagecontroller.
*
*/
// Include the essential config-file which also creates the $anax variable with its defaults.
include __DIR__ . '/config.php';
$hera['javascript_include'][] = 'js/register.js';
$hera['stylesheets'][] = 'css/forms.css';
$db = new CDatabase($hera['database']);
$user = new CUser($db);
// Check if user and password is okey
if (isset($_POST['send'])) {
if ($user->Register($_POST['acronym'], $_POST['name'], $_POST['password'], $_POST['confirm_password'])) {
header('Location: register.php?succes');
} else {
header('Location: register.php?fail&error=' . $user->getError());
}
}
$output = null;
if (isset($_GET['succes'])) {
$output = "<br><output class='success'>Din profil har skapats! <a href='login.php'>Logga in?</a></output><br><br>";
}
if (isset($_GET['fail'])) {
$output = "<br><output class='error'>Skapandet av profil misslyckades{$_GET['error']}</output><br><br>";
}
// Do it and store it all in variables in the Hera container.
$hera['title'] = "Bli medlem";
$hera['main'] = <<<EOD
<h1>Bli medlem</h1>
<form method=post>
<fieldset>