當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PEAR::raise_error方法代碼示例

本文整理匯總了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");
 }
開發者ID:BackupTheBerlios,項目名稱:serweb,代碼行數:84,代碼來源:apu_reg_confirmation.php


注:本文中的PEAR::raise_error方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。