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


PHP fz_config_get函数代码示例

本文整理汇总了PHP中fz_config_get函数的典型用法代码示例。如果您正苦于以下问题:PHP fz_config_get函数的具体用法?PHP fz_config_get怎么用?PHP fz_config_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: showAction

 /**
  * Action called to display user details
  */
 public function showAction()
 {
     $this->secure('admin');
     set('EditUserRight', fz_config_get('app', 'user_factory_class') === "Fz_User_Factory_Database");
     set('user', Fz_Db::getTable('User')->findById(params('id')));
     return html('user/show.php');
 }
开发者ID:romnvll,项目名称:FileZ,代码行数:10,代码来源:User.php

示例2: _findByUsernameAndPassword

 /**
  * Retrieve a user corresponding to $username and $password.
  *
  * @param string $username
  * @param string $password
  * @return array            User attributes if user was found, null if not
  */
 protected function _findByUsernameAndPassword($username, $password)
 {
     $bindValues = array(':username' => $username, ':password' => $password);
     $sql = 'SELECT * FROM ' . $this->getOption('db_table') . ' WHERE ' . fz_config_get('user_factory_options', 'db_username_field') . '=:username AND ' . fz_config_get('user_factory_options', 'db_password_field') . '=';
     $algorithm = trim($this->getOption('db_password_algorithm'));
     if (empty($algorithm)) {
         if (fz_config_get('user_factory_options', 'db_table') == 'fz_user') {
             $sql .= 'SHA1(CONCAT(salt, :password))';
         } else {
             // Shame on you !
             $sql .= ':password';
         }
     } else {
         if ($algorithm == 'MD5') {
             $sql .= 'MD5(:password)';
         } else {
             if ($algorithm == 'SHA1') {
                 $sql .= 'SHA1(:password)';
             } else {
                 if (is_callable($algorithm)) {
                     if (strstr($algorithm, '::') !== false) {
                         $algorithm = explode('::', $algorithm);
                     }
                     $sql .= $this->getConnection()->quote(call_user_func($algorithm, $password));
                     unset($bindValues[':password']);
                 } else {
                     $sql .= $algorithm;
                     // Plain SQL
                 }
             }
         }
     }
     return $this->fetchOne($sql, $bindValues);
 }
开发者ID:romnvll,项目名称:FileZ,代码行数:41,代码来源:Database.php

示例3: setPassword

 /**
  * Function used to encrypt the password
  *
  * @param string password
  */
 public function setPassword($password)
 {
     $algorithm = fz_config_get('user_factory_options', 'db_password_algorithm');
     $this->password = $password;
     $sql = null;
     if ($algorithm === null) {
         $sql = 'SHA1(CONCAT(:salt,:password))';
         $this->_updatedColumns[] = 'salt';
         // to force PDO::bindValue when updating
     } else {
         if ($algorithm == 'MD5') {
             $sql = 'MD5(:password)';
         } else {
             if ($algorithm == 'SHA1') {
                 $sql = 'SHA1(:password)';
             } else {
                 if (is_callable($algorithm)) {
                     if (strstr($algorithm, '::') !== false) {
                         $algorithm = explode('::', $algorithm);
                     }
                     $sql = Fz_Db::getConnection()->quote(call_user_func($algorithm, $password));
                 } else {
                     $sql = $algorithm;
                     // Plain SQL
                 }
             }
         }
     }
     if ($sql !== null) {
         $this->setColumnModifier('password', $sql);
     }
 }
开发者ID:kvenkat971,项目名称:FileZ,代码行数:37,代码来源:User.php

示例4: indexAction

 public function indexAction()
 {
     // Display the send_us_a_file.html page if the "Send us a file" feature is on and the user is not logged in.
     if (fz_config_get('app', 'send_us_a_file_feature') && false == $this->getUser()) {
         set('start_from', Zend_Date::now()->get(Zend_Date::DATE_SHORT));
         $maxUploadSize = min(Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('upload_max_filesize')), Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('post_max_size')));
         set('max_upload_size', $maxUploadSize);
         return html('send_us_a_file.html');
     }
     $this->secure();
     $user = $this->getUser();
     $freeSpaceLeft = max(0, Fz_Db::getTable('File')->getRemainingSpaceForUser($user));
     $maxUploadSize = min(Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('upload_max_filesize')), Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('post_max_size')), $freeSpaceLeft);
     $progressMonitor = fz_config_get('app', 'progress_monitor');
     $progressMonitor = new $progressMonitor();
     set('upload_id', md5(uniqid(mt_rand(), true)));
     set('start_from', Zend_Date::now()->get(Zend_Date::DATE_SHORT));
     set('refresh_rate', 1200);
     set('files', Fz_Db::getTable('File')->findByOwnerOrderByUploadDateDesc($user));
     set('use_progress_bar', $progressMonitor->isInstalled());
     set('upload_id_name', $progressMonitor->getUploadIdName());
     set('free_space_left', $freeSpaceLeft);
     set('max_upload_size', $maxUploadSize);
     set('sharing_destinations', fz_config_get('app', 'sharing_destinations', array()));
     set('disk_usage', array('space' => '<b id="disk-usage-value">' . bytesToShorthand(Fz_Db::getTable('File')->getTotalDiskSpaceByUser($user)) . '</b>', 'quota' => fz_config_get('app', 'user_quota')));
     return html('main/index.php');
 }
开发者ID:robyandelluk,项目名称:FileZ,代码行数:27,代码来源:Main.php

示例5: showAction

 /**
  * Action called to display user details
  */
 public function showAction()
 {
     $this->secure('admin');
     set('EditUserRight', fz_config_get('app', 'user_factory_class') === "Fz_User_Factory_Database");
     set('user', Fz_Db::getTable('User')->findById(params('id')));
     // Flash 'back_to' to come back here after a file deletion.
     flash('back_to', '/admin/users/' . params('id'));
     return html('user/show.php');
 }
开发者ID:robyandelluk,项目名称:FileZ,代码行数:12,代码来源:User.php

示例6: getFreeId

 /**
  * Return a free slot id in the fz_file table
  * 
  * @return integer
  */
 public function getFreeId()
 {
     $min = fz_config_get('app', 'min_hash_size');
     $max = fz_config_get('app', 'max_hash_size');
     $id = null;
     do {
         $id = base_convert($this->generateRandomHash($min, $max), 36, 10);
     } while ($this->rowExists($id));
     return $id;
 }
开发者ID:kvenkat971,项目名称:FileZ,代码行数:15,代码来源:File.php

示例7: downloadFzOneAction

 /**
  * Allows to download file with filez-1.x urls
  */
 public function downloadFzOneAction()
 {
     if (!fz_config_get('app', 'filez1_compat')) {
         halt(HTTP_FORBIDDEN);
     }
     $file = Fz_Db::getTable('File')->findByFzOneHash($_GET['ad']);
     if ($file === null) {
         halt(NOT_FOUND, __('There is no file for this code'));
     }
     set('file', $file);
     set('available', $file->isAvailable() || $file->isOwner($this->getUser()));
     set('uploader', $file->getUploader());
     return html('file/preview.php');
 }
开发者ID:romnvll,项目名称:FileZ,代码行数:17,代码来源:File.php

示例8: checkFilesAction

 /**
  * Action called to clean expired files and send mail to those who will be
  * in the next 2 days. This action is meant to be called from a cron script.
  * It should not respond any output except PHP execution errors. Everything
  * else is logged in 'filez-cron.log' and 'filez-cron-errors.log' files in
  * the configured log directory.
  */
 public function checkFilesAction()
 {
     // Delete files whose lifetime expired
     Fz_Db::getTable('File')->deleteExpiredFiles();
     // Send mail for files which will be deleted in less than 2 days
     $days = fz_config_get('cron', 'days_before_expiration_mail');
     foreach (Fz_Db::getTable('File')->findFilesToBeDeleted($days) as $file) {
         if ($file->notify_uploader) {
             $file->del_notif_sent = true;
             $file->save();
             $this->notifyDeletionByEmail($file);
         }
     }
 }
开发者ID:nahuelange,项目名称:FileZ,代码行数:21,代码来源:Admin.php

示例9: buildUserProfile

 /**
  * Translate profile var name from their original name.
  *
  * @param array   $profile
  * @return array            Translated profile
  */
 protected function buildUserProfile(array $profile)
 {
     $p = array();
     $translation = fz_config_get('user_attributes_translation', null, array());
     foreach ($translation as $key => $value) {
         if (array_key_exists($value, $profile)) {
             if (is_array($profile[$value])) {
                 $p[$key] = count($profile[$value]) > 0 ? $profile[$value][0] : null;
             } else {
                 $p[$key] = $profile[$value];
             }
         } else {
             fz_log('User_Factory: Missing attribute "' . $value . '" in user profile :', FZ_LOG_ERROR, $profile);
         }
     }
     return $p;
 }
开发者ID:nahuelange,项目名称:FileZ,代码行数:23,代码来源:Abstract.php

示例10: notifyDeletionByEmail

 /**
  * Notify the owner of the file passed as parameter that its file is going
  * to be deleted
  *
  * @param App_Model_File $file
  */
 private function notifyDeletionByEmail(App_Model_File $file)
 {
     try {
         option('translate')->setLocale(fz_config_get('app', 'default_locale'));
         option('locale')->setLocale(fz_config_get('app', 'default_locale'));
         $mail = $this->createMail();
         $user = $file->getUploader();
         $subject = __r('[FileZ] Your file "%file_name%" is going to be deleted', array('file_name' => $file->file_name));
         $msg = __r('email_delete_notif (%file_name%, %file_url%, %filez_url%, %available_until%)', array('file_name' => $file->file_name, 'file_url' => $file->getDownloadUrl(), 'filez_url' => url_for('/'), 'available_until' => $file->getAvailableUntil()->toString(Zend_Date::DATE_FULL)));
         $mail->setBodyText($msg);
         $mail->setSubject($subject);
         $mail->addTo($user->email);
         $mail->send();
         fz_log('Delete notification sent to ' . $user->email, FZ_LOG_CRON);
     } catch (Exception $e) {
         fz_log('Can\'t send email to ' . $user->email . ' file_id:' . $file->id, FZ_LOG_CRON_ERROR);
     }
 }
开发者ID:kvenkat971,项目名称:FileZ,代码行数:24,代码来源:Admin.php

示例11: indexAction

 public function indexAction()
 {
     $this->secure();
     $user = $this->getUser();
     $freeSpaceLeft = max(0, Fz_Db::getTable('File')->getRemainingSpaceForUser($user));
     $maxUploadSize = min(Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('upload_max_filesize')), Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('post_max_size')), $freeSpaceLeft);
     $progressMonitor = fz_config_get('app', 'progress_monitor');
     $progressMonitor = new $progressMonitor();
     set('upload_id', md5(uniqid(mt_rand(), true)));
     set('start_from', Zend_Date::now()->get(Zend_Date::DATE_SHORT));
     set('refresh_rate', 1200);
     set('files', Fz_Db::getTable('File')->findByOwnerOrderByUploadDateDesc($user));
     set('use_progress_bar', $progressMonitor->isInstalled());
     set('upload_id_name', $progressMonitor->getUploadIdName());
     set('free_space_left', $freeSpaceLeft);
     set('max_upload_size', $maxUploadSize);
     return html('main/index.php');
 }
开发者ID:JAlexandre,项目名称:FileZ,代码行数:18,代码来源:Main.php

示例12: fz_log

function fz_log($message, $type = null, $vars = null)
{
    if ($type == FZ_LOG_DEBUG && option('debug') !== true) {
        return;
    }
    if ($type !== null) {
        $type = '-' . $type;
    }
    $message = trim($message);
    if ($vars !== null) {
        $message .= var_export($vars, true) . "\n";
    }
    $message = str_replace("\n", "\n   ", $message);
    $message = '[' . strftime('%F %T') . '] ' . str_pad('[' . $_SERVER["REMOTE_ADDR"] . ']', 18) . $message . "\n";
    if (fz_config_get('app', 'log_dir') !== null) {
        $log_file = fz_config_get('app', 'log_dir') . '/filez' . $type . '.log';
        if (file_put_contents($log_file, $message, FILE_APPEND) === false) {
            trigger_error('Can\'t open log file (' . $log_file . ')', E_USER_WARNING);
        }
    }
    if (option('debug') === true) {
        debug_msg($message);
    }
}
开发者ID:nahuelange,项目名称:FileZ,代码行数:24,代码来源:fz_log.php

示例13: shareAction

 /**
  * Share a file url
  */
 public function shareAction()
 {
     $this->secure();
     $user = $this->getUser();
     $file = $this->getFile();
     $this->checkOwner($file, $user);
     set('sharing_destinations', fz_config_get('app', 'sharing_destinations'));
     set('downloadUrl', $file->getDownloadUrl());
     return html('file/_share_link.php');
 }
开发者ID:robyandelluk,项目名称:FileZ,代码行数:13,代码来源:File.php

示例14: createMail

 /**
  * Create an instance of Zend_Mail, set the default transport and the sender
  * info.
  *
  * @return Zend_Mail
  */
 protected function createMail()
 {
     if (self::$_mailTransportSet === false) {
         $config = fz_config_get('email');
         $config['name'] = 'filez';
         $transport = new Zend_Mail_Transport_Smtp($config['host'], $config);
         Zend_Mail::setDefaultTransport($transport);
         self::$_mailTransportSet = true;
     }
     $mail = new Zend_Mail('utf-8');
     $mail->setFrom($config['from_email'], $config['from_name']);
     return $mail;
 }
开发者ID:nahuelange,项目名称:FileZ,代码行数:19,代码来源:Controller.php

示例15: public_url_for

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
    <link rel="stylesheet" href="<?php 
echo public_url_for('resources/css/html5-reset.css');
?>
" type="text/css" media="all" />
    <link rel="stylesheet" href="<?php 
echo public_url_for('resources/css/main.css');
?>
" type="text/css" media="all" />

    <?php 
if (fz_config_get('looknfeel', 'custom_css', '') != '') {
    ?>
      <link rel="stylesheet" href="<?php 
    echo public_url_for(fz_config_get('looknfeel', 'custom_css'));
    ?>
" type="text/css" media="all" />
    <?php 
}
?>

    <!--[if lte IE 8]>
    <script type="text/javascript" src="<?php 
echo public_url_for('resources/js/html5.js');
?>
"></script>
    <![endif]-->

  </head>
  <body>
开发者ID:kvenkat971,项目名称:FileZ,代码行数:31,代码来源:doc.html.php


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