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


PHP Error::addWarning方法代码示例

本文整理汇总了PHP中Error::addWarning方法的典型用法代码示例。如果您正苦于以下问题:PHP Error::addWarning方法的具体用法?PHP Error::addWarning怎么用?PHP Error::addWarning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Error的用法示例。


在下文中一共展示了Error::addWarning方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: formAction

 /**
  * Handle form action
  */
 protected function formAction()
 {
     switch ($this->s->action) {
         case 'reload':
             // element: submenu
             $this->s->resetParams('form');
             $module = $this->s->loadModule($this->s->controller);
             $tpl = new Template('system');
             $tpl->assign('subnav', $this->generateNav($module->getSection()));
             $tpl->display('submenu.html');
             return true;
             break;
         case 'submenu':
             if ($this->s->element == '') {
                 Error::addWarning('Fehler: ID des Untermenüs ist nicht definiert!');
                 return false;
             }
             $section = str_replace('nav_', '', $this->s->element);
             $this->s->resetParams();
             $tpl = new Template('system');
             $tpl->assign('subnav', $this->generateNav($section));
             $tpl->display('submenu.html');
             return true;
             break;
         case 'cleanlog':
             if ($this->s->element == 'error') {
                 $file = fopen("logs/error.log", "w+");
                 fclose($file);
             }
             return true;
             break;
     }
 }
开发者ID:anhvn,项目名称:pokerspot,代码行数:36,代码来源:backend.class.php

示例2: handleForm

 /**
  * Handle the submitted forms.
  */
 protected final function handleForm()
 {
     // check, if user is logged in (except for /user/login OR /booking/website)
     if ($this->s->auth() === false && !($this->s->controller == 'user' && $this->s->action == 'login') && !($this->s->controller == 'booking' && $this->s->action == 'website')) {
         Error::addError('<strong>Die Anfrage konnte leider nicht bearbeitet werden</strong><br/>Sie sind nicht im System angemeldet!', true);
         return false;
     }
     // check if action is allowed for the user
     $right = $this->right();
     $action = $this->s->controller . ':' . $right;
     if (!($this->s->controller == 'user' && $this->s->action == 'login') && !($this->s->controller == 'booking' && $this->s->action == 'website') && !$this->s->user->hasRights($action) && array_key_exists($right, $this->registerRights())) {
         Error::addError('<strong>Die Anfrage konnte leider nicht bearbeitet werden</strong><br/>Du besitzt nicht die erforderlichen Rechte, um die Aktion ' . $action . ' auszuführen!', true);
         return false;
     }
     // get the validation rules for this action
     $rules = $this->config['rules'][$this->s->action];
     // is it a valid action?
     if (!is_array($rules)) {
         Error::addError('<strong>Die Anfrage konnte leider nicht bearbeitet werden</strong><br/>Interner Fehler: Es sind keine Regeln für die Aktion "' . $this->s->action . '" im Modul "' . $this->s->controller . '" definiert. Bitte benachrichtigen Sie den Administrator!', true);
         return false;
     }
     // validate the form fields using the rules of the module for this action
     $vars = array_merge($this->s->get, $this->s->post);
     $check = new Check($vars, $rules, $this->config["messages"]);
     if (true === $check->run($escape)) {
         // replace unfiltered post vars
         $this->vars = $check->vars;
         // execute the requested action
         return $this->formAction();
     } else {
         $this->form['errors'] = $check->errorFields;
         foreach ($check->errorMessages as $error) {
             Error::addWarning($error);
         }
         return false;
     }
 }
开发者ID:anhvn,项目名称:pokerspot,代码行数:40,代码来源:backend_controller.class.php

示例3: delete

 /**
  * delete current message from server
  *
  * @return bool
  * @author Elias Müller
  **/
 public function delete()
 {
     if (($error = $this->server->DeleteMessage($this->current)) == "") {
         return true;
     } else {
         Error::addWarning('Fehler beim Mail-Abruf: Eine Nachricht konnte nicht gelöscht werden', true);
     }
     return false;
 }
开发者ID:anhvn,项目名称:pokerspot,代码行数:15,代码来源:mail_receive.class.php

示例4: delete

 /**
  * delete the object
  */
 public function delete()
 {
     $db = DB::getInstance();
     if (!is_array($this->info['replies'])) {
         $sql = "DELETE FROM messages\n\t\t\t\t\t WHERE idmessage = " . $this->id;
         if ($db->query($sql) === true) {
             return true;
         }
     } else {
         Error::addWarning('Nachricht kann nicht gelöscht werden: Noch Antworten vorhanden!');
     }
     return false;
 }
开发者ID:anhvn,项目名称:pokerspot,代码行数:16,代码来源:message.class.php

示例5: login

 /**
  * login to the backend system
  *
  * @param string $username
  * @param string $password
  */
 public function login($username, $password)
 {
     session_start();
     $user = User::getInstance($username);
     //Error::addMessage($this->generateHash($password));
     if ($user !== false) {
         $hash = $this->generateHash($password, $user->password);
         if ($hash == $user->password) {
             $_SESSION['loggedin'] = $username;
             // set datetime of login
             $user->last_login = $user->current_login;
             $user->current_login = date("Y-m-d H:i:s");
             $user->save();
             // redirect to previous page
             $hostname = $_SERVER['HTTP_HOST'];
             $path = dirname($_SERVER['PHP_SELF']);
             header('Location: http://' . $hostname . ($path == '/' ? '' : $path) . '/' . ($this->s->config['site']['has_frontend'] === true ? 'admin/' : '') . $this->s->post["path"]);
             return true;
         }
     }
     $_SESSION['loggedin'] = 0;
     Error::addWarning("Login fehlgeschlagen! Benutzername und/oder Passwort falsch!");
     return false;
 }
开发者ID:anhvn,项目名称:pokerspot,代码行数:30,代码来源:backend.class.php


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