当前位置: 首页>>代码示例>>PHP>>正文


PHP CUser::getError方法代码示例

本文整理汇总了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
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:31,代码来源:do_user_aed.php

示例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 {
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:do_user_aed.php

示例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>
开发者ID:EmilSjunnesson,项目名称:rental,代码行数:31,代码来源:register.php


注:本文中的CUser::getError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。