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


PHP message::danger方法代码示例

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


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

示例1: loginPost

 protected static function loginPost()
 {
     $email = type::post('email', 'string');
     $password = type::post('password', 'string');
     $remember = type::post('remember', 'int');
     if (is_null($email) || is_null($password) || $email == '' || $password == '') {
         echo message::info(lang::get('fill_out_both'));
         return;
     }
     $sql = new sql();
     $sql->query('SELECT password, salt, id FROM ' . sql::table('user') . ' WHERE `email` = "' . $sql->escape($email) . '"');
     if (!$sql->num()) {
         echo message::danger(sprintf(lang::get('email_not_found'), htmlspecialchars($email)), true);
         $shake = 1;
         return;
     }
     $sql->result();
     if (!self::checkPassword($password, $sql->get('salt'), $sql->get('password'))) {
         echo message::danger(lang::get('wrong_pw'));
         $shake = 1;
         return;
     }
     self::loginSession();
     self::$userID = $sql->get('id');
     $_SESSION['login'] = $sql->get('id');
     if ($remember) {
         setcookie("remember", $sql->get('id'), time() + 3600 * 24 * 7);
     }
 }
开发者ID:DINKIN,项目名称:rokket,代码行数:29,代码来源:login.php

示例2: __construct

 public function __construct($host, $user, $pass)
 {
     $this->sftp = new Net_SFTP($host);
     if (!$this->sftp->login($user, $pass)) {
         echo message::danger(lang::get('sftp_login_failed'), false);
     }
 }
开发者ID:DINKIN,项目名称:rokket,代码行数:7,代码来源:sftp.php

示例3: loginPost

 protected static function loginPost()
 {
     $email = type::post('email', 'string');
     $password = type::post('password', 'string');
     // Formular ganz abgesendet?
     if (is_null($email) || is_null($password) || $email == '' || $password == '') {
         echo message::info(lang::get('login_form_notfull'), true);
         return;
     }
     $sql = sql::factory();
     $sql->query('SELECT password, id FROM ' . sql::table('user') . ' WHERE `email` = "' . $sql->escape($email) . '"');
     // Username mit E-Mail vorhanden?
     if (!$sql->num()) {
         echo message::danger(sprintf(lang::get('login_no_user'), $email), true);
         return;
     }
     $sql->result();
     // Password nicht gleich?
     if (!self::checkPassword($password, $sql->get('password'))) {
         echo message::danger(lang::get('login_pwd_false'), true);
         return;
     }
     self::loginSession();
     self::$userID = $sql->get('id');
     $_SESSION['login'] = $sql->get('id') . '||' . self::hash($password);
 }
开发者ID:pasternt,项目名称:dynaoCMS,代码行数:26,代码来源:login.php

示例4: __construct

 public function __construct($host, $user, $pass)
 {
     $this->host = $host;
     $this->user = $user;
     $this->password = $pass;
     $this->ssh = new Net_SSH2($host);
     if (!$this->ssh->login($user, $pass)) {
         echo message::danger(lang::get('ssh_login_failed'), false);
         return false;
     }
     return $this->ssh;
 }
开发者ID:kyroskoh,项目名称:rokket,代码行数:12,代码来源:ssh.php

示例5: result

 public function result($query = false, $type = MYSQL_ASSOC)
 {
     try {
         if ($query) {
             $this->query($query);
         }
         if (!in_array($type, self::$QUERY_TYPE)) {
             throw new Exception(sprintf(lang::get('sql_result_invalid_type'), __CLASS__));
         }
         $this->result = $this->query->fetch_array($type);
     } catch (Exception $e) {
         echo message::danger($e->getMessage());
     }
     return $this;
 }
开发者ID:DINKIN,项目名称:rokket,代码行数:15,代码来源:sql.php

示例6: checkNeed

 public function checkNeed()
 {
     $errors = [];
     foreach ($this->get('need', []) as $key => $value) {
         $check = addonNeed::check($key, $value);
         if ($check !== true) {
             $errors[] = $check;
         }
     }
     if (!empty($errors)) {
         echo message::danger(implode('<br />', $errors));
         return false;
     }
     return true;
 }
开发者ID:DINKIN,项目名称:rokket,代码行数:15,代码来源:addon.php

示例7: checkNeed

 public function checkNeed()
 {
     $errors = [];
     foreach ($this->get('need', []) as $key => $value) {
         $check = templateNeed::check($key, $value);
         // Typcheck, because $check can be a string
         if ($check !== true) {
             $errors[] = $check;
         }
     }
     if (!empty($errors)) {
         echo message::danger(implode('<br />', $errors));
         return false;
     }
     return true;
 }
开发者ID:pasternt,项目名称:dynaoCMS,代码行数:16,代码来源:template.php

示例8: add

 /**
  * Fügt eine Erweiterung hinzu
  *
  * @param	string	$name			Der Name der Erweiterung
  * @param	string	$function		Die Funktion die auf die Erweiterung zugreift
  * @param	int		$position		Die Position wann die Funktion aufgerufen werden soll
  *
  */
 public static function add($name, $function, $position = -1)
 {
     try {
         if (!is_callable($function)) {
             throw new Exception(sprintf(lang::get('extension_callable_func'), _CLASS__));
             return false;
         }
         self::$extensions[$name] = [];
         if ($position < 0) {
             $position = count(self::$extensions[$name]);
         }
         // Funktion hinzufügen zum $name mit der Position $position
         array_splice(self::$extensions[$name], $position, 0, $function);
         return true;
     } catch (Exception $e) {
         echo message::danger($e->getMessage());
     }
 }
开发者ID:pasternt,项目名称:dynaoCMS,代码行数:26,代码来源:extension.php

示例9: result

 public function result($query = false, $type = MYSQL_ASSOC)
 {
     try {
         if ($query) {
             $this->query($query);
         }
         if (!in_array($type, [MYSQLI_NUM, MYSQLI_ASSOC, MYSQLI_BOTH])) {
             throw new Exception(sprintf(lang::get('sql_result_invalid_type'), __CLASS__));
         }
         if (!$this->query) {
             throw new Exception(lang::get('sql_result_error'));
         } else {
             $this->result = $this->query->fetch_array($type);
         }
         return $this;
     } catch (Exception $e) {
         echo message::danger($e->getMessage());
     }
 }
开发者ID:pasternt,项目名称:dynaoCMS,代码行数:19,代码来源:sql.php

示例10: exportTables

 public static function exportTables()
 {
     if (!isset($_POST["export"])) {
         echo message::danger(lang::get('exportSelect'), true);
     } else {
         $result = '';
         foreach ($_POST["export"] as $table => $status) {
             $DB = dyn::get('DB');
             $prefix = strlen($DB['prefix']);
             $result .= 'DROP TABLE IF EXISTS `dynaoimportexporttoll' . $table . '`;';
             $sql = sql::factory();
             $sql->query('SHOW CREATE TABLE ' . $DB['prefix'] . $table)->result();
             $creatTable = "\n\n" . str_replace("CREATE TABLE `" . $DB['prefix'], "CREATE TABLE IF NOT EXISTS `dynaoimportexporttoll", $sql->get("Create Table")) . ";\n\n";
             $result .= preg_replace("/(`.*` int.* DEFAULT) '(.*)'/", '${1} ${2}', $creatTable);
             $sql->query("SELECT * FROM " . $DB['prefix'] . $table)->result();
             while ($sql->isNext()) {
                 $result .= 'INSERT INTO `dynaoimportexporttoll' . $table . '` VALUES(';
                 $i = 1;
                 foreach ($sql->result as $row) {
                     $result .= "'" . $sql->escape(str_replace(";", "`#semikolon#`", $row)) . "'";
                     if (count($sql->result) > $i) {
                         $result .= ",";
                     }
                     $i++;
                 }
                 $result .= ");\n";
                 $sql->next();
             }
         }
         $length = strlen($result);
         header('Content-Description: File Transfer');
         header('Content-Type: application/sql');
         header('Content-Disposition: attachment; filename=backup.sql');
         header('Content-Transfer-Encoding: binary');
         header('Content-Length: ' . $length);
         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
         header('Expires: 0');
         header('Pragma: public');
         echo $result;
         exit;
     }
 }
开发者ID:pasterntt,项目名称:dynao-CMS,代码行数:42,代码来源:export.php

示例11: loginPost

 protected static function loginPost()
 {
     $email = type::post('email', 'string');
     $password = type::post('password', 'string');
     // Formular ganz abgesendet?
     if (is_null($email) || is_null($password) || $email == '' || $password == '') {
         echo message::info(lang::get('login_form_notfull'), true);
         return;
     }
     $sql = sql::factory();
     $sql->query('SELECT password, salt, id FROM ' . sql::table('user') . ' WHERE `email` = "' . $sql->escape($email) . '"');
     // Username mit E-Mail vorhanden?
     if (!$sql->num()) {
         echo message::danger(sprintf(lang::get('login_no_user'), htmlspecialchars($email)), true);
         return;
     }
     $sql->result();
     // Password nicht gleich?
     if (!self::checkPassword($password, $sql->get('salt'), $sql->get('password'))) {
         echo message::danger(lang::get('login_pwd_false'), true);
         return;
     }
     self::loginSession();
     self::$userID = $sql->get('id');
     $_SESSION['login'] = $sql->get('id');
     // Falls alte Methode (sha1) neuen Salt generieren und salt updaten
     // sha1 deprecated 0.2 Beta
     $salt = $sql->get('salt');
     if (empty($salt)) {
         $salt = self::generateSalt();
         $sql->setTable('user');
         $sql->setWhere('`email` = "' . $email . '"');
         $sql->addPost('salt', $salt);
         $sql->addPost('password', self::hash($password, $salt));
         $sql->update();
     }
 }
开发者ID:pasterntt,项目名称:dynaoCMS,代码行数:37,代码来源:login.php

示例12: checkLogin

 public static function checkLogin()
 {
     $username = type::post('username', 'string', '');
     $password = type::post('password', 'string', '');
     if ($username == '' || $password == '') {
         echo message::info(lang::get('login_form_notfull'), true);
         return;
     }
     $sql = sql::factory();
     $sql->query('SELECT password, salt, id FROM ' . sql::table('community_user') . ' WHERE `username` = "' . $sql->escape($username) . '"');
     if (!$sql->num()) {
         echo message::danger(sprintf(lang::get('login_no_user'), $email), true);
         return;
     }
     $sql->result();
     if (!userLogin::checkPassword($password, $sql->get('salt'), $sql->get('password'))) {
         echo message::danger(lang::get('login_pwd_false'), true);
         return;
     }
     $_SESSION['community-login'] = $sql->get('id');
     self::checkSession();
     // Für spätere Foren-Bridges
     extension::get('COMMUNITY_USER_LOGIN', $password);
 }
开发者ID:pasterntt,项目名称:dynao-CMS,代码行数:24,代码来源:community_user.php

示例13: template

$field->addValidator('notEmpty', lang::get('validator_not_empty'));
$field->fieldName(lang::get('password'));
if ($form->isSubmit()) {
    $sql = sql::connect($form->get('db_host'), $form->get('db_user'), $form->get('db_password'), $form->get('db_database'));
    if (is_null($sql)) {
        $DB = ['host' => $form->get('db_host'), 'user' => $form->get('db_user'), 'password' => $form->get('db_password'), 'database' => $form->get('db_database'), 'prefix' => $form->get('db_prefix')];
        dyn::add('DB', $DB, true);
        dyn::add('setup', false, true);
        dyn::save();
        install::newInstall();
        install::insertDemoContent();
        $template = new template(dyn::get('template'));
        if ($template->install() !== true) {
            $form->setSuccessMessage(null);
            $error = true;
        }
        $form->addParam('page', 'finish');
    } else {
        echo message::danger($sql);
    }
}
echo $form->show();
?>
                
                </div>
        
        </div>
    
    </div>
    
</div>
开发者ID:pasternt,项目名称:dynaoCMS,代码行数:31,代码来源:database.php

示例14: foreach

    echo message::success($success);
}
layout::addNav(lang::get('dashboard'), 'dashboard', 'home', ['refresh'], true);
layout::addNav(lang::get('settings'), 'settings', 'settings', [], false);
layout::addNav(lang::get('server'), 'server', 'list', ['add'], true);
layout::addNav(lang::get('addons'), 'addons', 'alt', [], true);
layout::addNav(lang::get('user'), 'user', 'users', ['add'], true);
foreach (addonConfig::includeAllConfig() as $file) {
    include $file;
}
if (userLogin::isLogged()) {
    $path = 'pages/' . $page . '.php';
    $path = extension::get('PAGE_PATH', $path);
    if (file_exists($path)) {
        include $path;
    } else {
        echo message::danger(lang::get('page_not_found'), false);
    }
}
$content = ob_get_contents();
ob_end_clean();
rp::add('content', $content);
if (ajax::is()) {
    echo ajax::getReturn();
    die;
}
if (userLogin::isLogged()) {
    include dir::layout('index.php', rp::get('layout'));
} else {
    include dir::layout('login.php', rp::get('layout'));
}
开发者ID:kyroskoh,项目名称:rokket,代码行数:31,代码来源:index.php

示例15: getNaviInclude

 public static function getNaviInclude($addon = false)
 {
     self::setCurrents();
     if (isset(self::$navi[self::getPageName()])) {
         $current = self::$navi[self::getPageName()];
     } else {
         $current = self::$addonNavi[self::getPageName()];
     }
     // isset gibt bei null false aus
     if (isset($current['callback']) && is_callable($current['callback'])) {
         return $current['callback']();
     }
     $page = self::$getVars[0];
     if (!$addon) {
         if (file_exists(dir::page($page . '.php'))) {
             return dir::page($page . '.php');
         }
     } else {
         if (file_exists(dir::addon($addon, 'page' . DIRECTORY_SEPARATOR . $page . '.php'))) {
             return dir::addon($addon, 'page' . DIRECTORY_SEPARATOR . $page . '.php');
         }
     }
     echo message::danger(lang::get('page_not_found'));
     return false;
 }
开发者ID:pasterntt,项目名称:dynao-CMS,代码行数:25,代码来源:backend.php


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