本文整理汇总了PHP中PEAR::raise_error方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR::raise_error方法的具体用法?PHP PEAR::raise_error怎么用?PHP PEAR::raise_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR
的用法示例。
在下文中一共展示了PEAR::raise_error方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_confirm_reg
function action_confirm_reg(&$errors)
{
global $data, $config, $lang_str;
if (isset($_GET['pr'])) {
$proxy['proxy'] = base64_decode($_GET['pr']);
if ($proxy['proxy']) {
if (false === $data->set_home_proxy($proxy['proxy'])) {
return false;
}
}
}
if (isModuleLoaded('xxl') and !$proxy['proxy']) {
$errors[] = $lang_str['err_reg_conf_not_exists_conf_num'];
return false;
}
$an =& $config->attr_names;
/* get uid */
$o = array('name' => $an['confirmation'], 'value' => $this->nr);
if (false === ($attrs = $data->get_attr_by_val("user", $o))) {
return false;
}
if (empty($attrs[0]['id'])) {
$this->wrong_nr = true;
ErrorHandler::add_error($lang_str['err_reg_conf_not_exists_conf_num']);
return false;
}
$uid = $attrs[0]['id'];
/* get did - for the case that domain has been created during registration */
$o = array('name' => $an['confirmation'], 'value' => $this->nr);
if (false === ($attrs = $data->get_attr_by_val("domain", $o))) {
return false;
}
$did = null;
if (!empty($attrs[0]['id'])) {
$did = $attrs[0]['id'];
}
if (false === $data->transaction_start()) {
return false;
}
// first enable domain
if (!is_null($did)) {
$dm_h =& DomainManipulator::singleton($did);
if (false === $dm_h->enable_domain(true)) {
return false;
}
$domain_attrs =& Domain_Attrs::singleton($did);
if (false === $domain_attrs->unset_attribute($an['confirmation'])) {
$data->transaction_rollback();
return false;
}
if (false === $domain_attrs->unset_attribute($an['pending_ts'])) {
$data->transaction_rollback();
return false;
}
}
$o = array("uid" => $uid, "disable" => false);
if (false === $data->enable_user($o)) {
$data->transaction_rollback();
return false;
}
$user_attrs =& User_Attrs::singleton($uid);
if (false === $user_attrs->unset_attribute($an['confirmation'])) {
$data->transaction_rollback();
return false;
}
if (false === $user_attrs->unset_attribute($an['pending_ts'])) {
$data->transaction_rollback();
return false;
}
if (false === $data->transaction_commit()) {
return false;
}
if ($this->opt['setup_jabber_account']) {
ErrorHandler::add_error("Registration in jabber not maintained, please set \$config->setup_jabber_account=false in config file.");
# Jabber Gateway registration
$res = reg_jab($user_id->uname);
if ($res != 0) {
$res = $res + 1;
log_errors(PEAR::raise_error("jabber registration failed: <" . $user_id->uname . "> [" . $res . "]"), $errors);
return array("confirmation_ok=1", "conf_jabber_failed=1");
}
}
return array("confirmation_ok=1");
}