• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP func_check函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ValidateUrl

 /**
  * Проверка URL форума
  *
  * @param $sValue
  * @param $aParams
  * @return bool | string
  */
 public function ValidateUrl($sValue, $aParams)
 {
     if (!$sValue || func_check($sValue, 'login', 2, 50)) {
         return true;
     }
     return $this->Lang_Get('plugin.forum.create_url_error', array('min' => 2, 'max' => 50));
 }
开发者ID:Kreddik,项目名称:lsplugin-forum,代码行数:14,代码来源:Forum.entity.class.php


示例2: EventAjaxBlogInfo

 /**
  * Получить информацию о блоге
  *
  * @return bool
  */
 public function EventAjaxBlogInfo()
 {
     $this->Viewer_SetResponseAjax('json');
     $sBlogName = getRequest('param');
     if (!is_string($sBlogName) or !func_check($sBlogName, 'login', 3, 50)) {
         $this->Message_AddError('Error in blog`s name');
         return false;
     }
     if (!($oBlog = $this->Blog_GetBlogByUrl($sBlogName))) {
         return false;
     }
     // get blog users with all roles
     $aBlogAdministratorsResult = $this->Blog_GetBlogUsersByBlogId($oBlog->getId(), ModuleBlog::BLOG_USER_ROLE_ADMINISTRATOR);
     $aBlogAdministrators = $aBlogAdministratorsResult['collection'];
     $aBlogModeratorsResult = $this->Blog_GetBlogUsersByBlogId($oBlog->getId(), ModuleBlog::BLOG_USER_ROLE_MODERATOR);
     $aBlogModerators = $aBlogModeratorsResult['collection'];
     $aBlogUsersResult = $this->Blog_GetBlogUsersByBlogId($oBlog->getId(), ModuleBlog::BLOG_USER_ROLE_USER, 1, Config::Get('plugin.popupinfo.Blog_User_On_Page'));
     $aBlogUsers = $aBlogUsersResult['collection'];
     $oViewer = $this->Viewer_GetLocalViewer();
     $oViewer->Assign('oBlog', $oBlog);
     $oViewer->Assign('aBlogAdministrators', $aBlogAdministrators);
     $oViewer->Assign('aBlogModerators', $aBlogModerators);
     $oViewer->Assign('aBlogUsers', $aBlogUsers);
     $oViewer->Assign('iCountBlogAdministrators', $aBlogAdministratorsResult['count'] + 1);
     $oViewer->Assign('iCountBlogModerators', $aBlogModeratorsResult['count']);
     $oViewer->Assign('iCountBlogUsers', $aBlogUsersResult['count']);
     $oViewer->Assign('oUserCurrent', $this->oUserCurrent);
     $this->Viewer_AssignAjax('sText', $oViewer->Fetch(Plugin::GetTemplatePath(__CLASS__) . '/getbloginfo.tpl'));
 }
开发者ID:psnet,项目名称:popupinfo,代码行数:34,代码来源:ActionPopupinfo.class.php


示例3: EventAjaxSubscribeToggle

 /**
  * Изменение состояния подписки
  */
 protected function EventAjaxSubscribeToggle()
 {
     $this->Viewer_SetResponseAjax('json');
     /**
      * Получаем емайл подписки и проверяем его на валидность
      */
     $sMail = getRequest('mail');
     if ($this->oUserCurrent) {
         $sMail = $this->oUserCurrent->getMail();
     }
     if (!func_check($sMail, 'mail')) {
         $this->Message_AddError($this->Lang_Get('registration_mail_error'), $this->Lang_Get('error'));
         return;
     }
     /**
      * Получаем тип объекта подписки
      */
     $sTargetType = getRequest('target_type');
     if (!$this->Subscribe_IsAllowTargetType($sTargetType)) {
         $this->Message_AddError($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     $sTargetId = getRequest('target_id') ? getRequest('target_id') : null;
     $iValue = getRequest('value') ? 1 : 0;
     $oSubscribe = null;
     /**
      * Есть ли доступ к подписке гостям?
      */
     if (!$this->oUserCurrent and !$this->Subscribe_IsAllowTargetForGuest($sTargetType)) {
         $this->Message_AddError($this->Lang_Get('need_authorization'), $this->Lang_Get('error'));
         return;
     }
     /**
      * Проверка объекта подписки
      */
     if (!$this->Subscribe_CheckTarget($sTargetType, $sTargetId, $iValue)) {
         $this->Message_AddError($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     /**
      * Если подписка еще не существовала, то создаем её
      */
     $oSubscribe = $this->Subscribe_AddSubscribeSimple($sTargetType, $sTargetId, $sMail);
     if ($oSubscribe) {
         $oSubscribe->setStatus($iValue);
         $this->Subscribe_UpdateSubscribe($oSubscribe);
         $this->Message_AddNotice($this->Lang_Get('subscribe_change_ok'), $this->Lang_Get('attention'));
         return;
     }
     $this->Message_AddError($this->Lang_Get('system_error'), $this->Lang_Get('error'));
     return;
 }
开发者ID:narush,项目名称:livestreet,代码行数:55,代码来源:ActionSubscribe.class.php


示例4: EventParamsSubmit

 protected function EventParamsSubmit()
 {
     $bOk = true;
     if (isset($_POST['param_reserved_urls'])) {
         $aReservedUrls = explode(',', preg_replace("/\\s+/", '', getRequest('param_reserved_urls')));
         $aNewReservedUrls = array();
         foreach ($aReservedUrls as $sUrl) {
             if (func_check($sUrl, 'login', 1, 50)) {
                 $aNewReservedUrls[] = $sUrl;
             }
         }
         $this->aConfig['reserverd_urls'] = $aNewReservedUrls;
         $sReservedUrls = implode(',', $aNewReservedUrls);
         $result = $this->PluginAceadminpanel_Admin_SetValue('param_reserved_urls', $sReservedUrls);
         $bOk = $bOk and $result['result'];
     }
     if (isset($_POST['param_items_per_page'])) {
         $result = $this->PluginAceadminpanel_Admin_SetValue('param_items_per_page', intval(getRequest('param_items_per_page')));
         $bOk = $bOk and $result['result'];
     }
     if (isset($_POST['param_votes_per_page'])) {
         $result = $this->PluginAceadminpanel_Admin_SetValue('param_votes_per_page', intval(getRequest('param_votes_per_page')));
         $bOk = $bOk and $result['result'];
     }
     if (isset($_POST['param_edit_footer'])) {
         $result = $this->PluginAceadminpanel_Admin_SetValue('param_edit_footer', getRequest('param_edit_footer'));
         $bOk = $bOk and $result['result'];
     }
     if (isset($_POST['param_vote_value'])) {
         $result = $this->PluginAceadminpanel_Admin_SetValue('param_vote_value', intval(getRequest('param_vote_value')));
         $bOk = $bOk and $result['result'];
     }
     if (isset($_POST['param_check_password'])) {
         $param = intval(getRequest('param_check_password'));
     } else {
         $param = 0;
     }
     $result = $this->PluginAceadminpanel_Admin_SetValue('param_check_password', $param);
     $bOk = $bOk and $result['result'];
     if ($bOk) {
         $this->_InitParams();
     }
     return $bOk;
 }
开发者ID:lunavod,项目名称:bunker_stable,代码行数:44,代码来源:ActionAdmin_EventParams.class.php


示例5: EventSetBestComment

 protected function EventSetBestComment()
 {
     if (!$this->oUserCurrent) {
         $this->Message_AddErrorSingle($this->Lang_Get('need_authorization'), $this->Lang_Get('error'));
         return;
     }
     if (func_check(getRequest('commentId', null, 'post'), 'id', 1, 11)) {
         $commentId = getRequest('commentId', null, 'post');
     }
     if (!($oComment = $this->Comment_GetCommentById($commentId))) {
         $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     if (!$oComment->isBestable()) {
         $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     if (!($oComment = $this->Comment_GetCommentById($commentId))) {
         $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     if (!($oTopic = $this->Topic_GetTopicById($oComment->getTargetId()))) {
         $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     $oTopic = $this->Topic_GetTopicById($oComment->getTargetId());
     if ($oComment->isBestable() && $oTopic->getIsAllowBestComment()) {
         if ($oComment->getCommentId() == $oComment->getTarget()->getBestCommentId()) {
             $oTopic->setBestCommentId(0);
             $sMsg = $this->Lang_Get('plugin.qa.comment_unset_best');
             $sTextToggle = $this->Lang_Get('plugin.qa.setbest');
         } else {
             $oTopic->setBestCommentId($oComment->getCommentId());
             $sMsg = $this->Lang_Get('plugin.qa.comment_set_best');
             $sTextToggle = $this->Lang_Get('plugin.qa.unsetbest');
         }
         $this->Topic_UpdateTopic($oTopic);
         $this->Message_AddNoticeSingle($sMsg, $this->Lang_Get('attention'));
         $this->Viewer_AssignAjax('sTextToggle', $sTextToggle);
     }
 }
开发者ID:shtrih,项目名称:alto-plugin-qa,代码行数:41,代码来源:ActionAjax.class.php


示例6: BuildFilter

 /**
  * Формирует из REQUEST массива фильтр для отбора отчетов
  *
  * @return array
  */
 protected function BuildFilter()
 {
     $aFilter = array();
     if ($start = getRequest('start')) {
         if (func_check($start, 'text', 6, 10) && substr_count($start, '.') == 2) {
             list($d, $m, $y) = explode('.', $start);
             if (@checkdate($m, $d, $y)) {
                 $aFilter['date_min'] = "{$y}-{$m}-{$d}";
             } else {
                 $this->Message_AddError($this->Lang_Get('plugin.profiler.filter_error_date_format'), $this->Lang_Get('plugin.profiler.filter_error'));
                 unset($_REQUEST['start']);
             }
         } else {
             $this->Message_AddError($this->Lang_Get('plugin.profiler.filter_error_date_format'), $this->Lang_Get('plugin.profiler.filter_error'));
             unset($_REQUEST['start']);
         }
     }
     if ($end = getRequest('end')) {
         if (func_check($end, 'text', 6, 10) && substr_count($end, '.') == 2) {
             list($d, $m, $y) = explode('.', $end);
             if (@checkdate($m, $d, $y)) {
                 $aFilter['date_max'] = "{$y}-{$m}-{$d} 23:59:59";
             } else {
                 $this->Message_AddError($this->Lang_Get('plugin.profiler.filter_error_date_format'), $this->Lang_Get('plugin.profiler.filter_error'));
                 unset($_REQUEST['end']);
             }
         } else {
             $this->Message_AddError($this->Lang_Get('plugin.profiler.filter_error_date_format'), $this->Lang_Get('plugin.profiler.filter_error'));
             unset($_REQUEST['end']);
         }
     }
     if ($iTimeFull = getRequest('time') and $iTimeFull > 0) {
         $aFilter['time'] = $iTimeFull;
     }
     if ($iPerPage = getRequest('per_page', 0) and $iPerPage > 0) {
         Config::Set('plugins.profiler.per_page', $iPerPage);
     }
     return $aFilter;
 }
开发者ID:cbrspc,项目名称:LIVESTREET-1-DISTRIB,代码行数:44,代码来源:ActionProfiler.class.php


示例7: CheckPageFields

 /**
  * Проверка полей на корректность
  *
  * @return unknown
  */
 protected function CheckPageFields()
 {
     $this->Security_ValidateSendForm();
     $bOk = true;
     /**
      * Проверяем есть ли заголовок топика
      */
     if (!func_check(getRequest('page_title', null, 'post'), 'text', 2, 200)) {
         $this->Message_AddError($this->Lang_Get('plugin.page.create_title_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Проверяем есть ли заголовок топика, с заменой всех пробельных символов на "_"
      */
     $pageUrl = preg_replace("/\\s+/", '_', (string) getRequest('page_url', null, 'post'));
     $_REQUEST['page_url'] = $pageUrl;
     if (!func_check(getRequest('page_url', null, 'post'), 'login', 1, 50)) {
         $this->Message_AddError($this->Lang_Get('plugin.page.create_url_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Проверяем на счет плохих УРЛов
      */
     if (in_array(getRequest('page_url', null, 'post'), $this->aBadPageUrl)) {
         $this->Message_AddError($this->Lang_Get('plugin.page.create_url_error_bad') . ' ' . join(',', $this->aBadPageUrl), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Проверяем есть ли содержание страницы
      */
     if (!func_check(getRequest('page_text', null, 'post'), 'text', 1, 50000)) {
         $this->Message_AddError($this->Lang_Get('plugin.page.create_text_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Проверяем страницу в которую хотим вложить
      */
     if (getRequest('page_pid') != 0 and !($oPageParent = $this->PluginPage_Page_GetPageById(getRequest('page_pid')))) {
         $this->Message_AddError($this->Lang_Get('plugin.page.create_parent_page_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Проверяем сортировку
      */
     if (getRequest('page_sort') and !is_numeric(getRequest('page_sort'))) {
         $this->Message_AddError($this->Lang_Get('plugin.page.create_sort_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Выполнение хуков
      */
     $this->Hook_Run('check_page_fields', array('bOk' => &$bOk));
     return $bOk;
 }
开发者ID:lunavod,项目名称:bunker_stable,代码行数:59,代码来源:ActionPage.class.php


示例8: EventReminder

 /**
  * Обработка напоминания пароля
  *
  */
 protected function EventReminder()
 {
     $this->Viewer_AddHtmlTitle($this->Lang_Get('password_reminder'));
     if ($this->GetParam(0) == 'send') {
         $this->SetTemplateAction('reminder_send');
         return;
     }
     /**
      * Проверка кода на восстановление пароля и генерация нового пароля
      */
     if (func_check($this->GetParam(0), 'md5')) {
         if ($oReminder = $this->User_GetReminderByCode($this->GetParam(0))) {
             if (!$oReminder->getIsUsed() and strtotime($oReminder->getDateExpire()) > time() and $oUser = $this->User_GetUserById($oReminder->getUserId())) {
                 $sNewPassword = func_generator(7);
                 $oUser->setPassword(func_encrypt($sNewPassword));
                 if ($this->User_Update($oUser)) {
                     $oReminder->setDateUsed(date("Y-m-d H:i:s"));
                     $oReminder->setIsUsed(1);
                     $this->User_UpdateReminder($oReminder);
                     $this->Notify_SendReminderPassword($oUser, $sNewPassword);
                     $this->SetTemplateAction('reminder_confirm');
                     return;
                 }
             }
         }
         $this->Message_AddErrorSingle($this->Lang_Get('password_reminder_bad_code'), $this->Lang_Get('error'));
         return Router::Action('error');
     }
     /**
      * Обрабатываем запрос на смену пароля
      */
     if (isPost('submit_reminder')) {
         if (func_check(getRequest('mail'), 'mail') and $oUser = $this->User_GetUserByMail(getRequest('mail'))) {
             /**
              * Формируем и отправляем ссылку на смену пароля
              */
             $oReminder = Engine::GetEntity('User_Reminder');
             $oReminder->setCode(func_generator(32));
             $oReminder->setDateAdd(date("Y-m-d H:i:s"));
             $oReminder->setDateExpire(date("Y-m-d H:i:s", time() + 60 * 60 * 24 * 7));
             $oReminder->setDateUsed(null);
             $oReminder->setIsUsed(0);
             $oReminder->setUserId($oUser->getId());
             if ($this->User_AddReminder($oReminder)) {
                 $this->Notify_SendReminderCode($oUser, $oReminder);
                 Router::Location(Router::GetPath('login') . 'reminder/send/');
             }
         } else {
             $this->Message_AddError($this->Lang_Get('password_reminder_bad_email'), $this->Lang_Get('error'));
         }
     }
 }
开发者ID:lifecom,项目名称:Huddlebuddle,代码行数:56,代码来源:ActionLogin.class.php


示例9: AjaxAddComment

 /**
  * Обработка добавление комментария к топику через ajax
  */
 protected function AjaxAddComment()
 {
     $this->Viewer_SetResponseAjax();
     $isGuest = false;
     /**
      * Проверям авторизован ли пользователь
      */
     if (!$this->User_IsAuthorization()) {
         $this->oUserCurrent = $this->User_GetUserById(0);
         $isGuest = true;
         if (!Config::Get('plugin.guestcomments.enabled')) {
             $this->Message_AddErrorSingle($this->Lang_Get('need_authorization'), $this->Lang_Get('error'));
             return;
         }
         if (!func_check(getRequest("guest_name"), "text", 2, 20)) {
             $this->Message_AddErrorSingle($this->Lang_Get('plugin.guestcomments.error_name'), $this->Lang_Get('error'));
             return;
         }
         if (!func_check(getRequest("guest_email"), "mail")) {
             $this->Message_AddErrorSingle($this->Lang_Get('plugin.guestcomments.error_mail'), $this->Lang_Get('error'));
             return;
         }
         if (!isset($_SESSION['captcha_keystring']) or $_SESSION['captcha_keystring'] != strtolower(getRequest('captcha'))) {
             $this->Message_AddErrorSingle($this->Lang_Get('plugin.guestcomments.error_captcha'), $this->Lang_Get('error'));
             return;
         }
     }
     /**
      * Проверяем топик
      */
     if (!($oTopic = $this->Topic_GetTopicById(getRequest('cmt_target_id')))) {
         $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     /**
      * Возможность постить коммент в топик в черновиках
      */
     if (!$oTopic->getPublish() and $this->oUserCurrent->getId() != $oTopic->getUserId() and !$this->oUserCurrent->isAdministrator()) {
         $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     /**
      * Проверяем разрешено ли постить комменты
      */
     if (!$this->ACL_CanPostComment($this->oUserCurrent) and !$this->oUserCurrent->isAdministrator()) {
         $this->Message_AddErrorSingle($this->Lang_Get('topic_comment_acl'), $this->Lang_Get('error'));
         return;
     }
     /**
      * Проверяем разрешено ли постить комменты по времени
      */
     if (!$this->ACL_CanPostCommentTime($this->oUserCurrent) and !$this->oUserCurrent->isAdministrator()) {
         $this->Message_AddErrorSingle($this->Lang_Get('topic_comment_limit'), $this->Lang_Get('error'));
         return;
     }
     /**
      * Проверяем запрет на добавления коммента автором топика
      */
     if ($oTopic->getForbidComment()) {
         $this->Message_AddErrorSingle($this->Lang_Get('topic_comment_notallow'), $this->Lang_Get('error'));
         return;
     }
     /**
      * Проверяем текст комментария
      */
     if ($isGuest == true) {
         $sText = nl2br(strip_tags(getRequest('comment_text')));
     } else {
         $sText = $this->Text_Parser(getRequest('comment_text'));
     }
     if (!func_check($sText, 'text', 2, 10000)) {
         $this->Message_AddErrorSingle($this->Lang_Get('topic_comment_add_text_error'), $this->Lang_Get('error'));
         return;
     }
     /**
      * Проверям на какой коммент отвечаем
      */
     $sParentId = (int) getRequest('reply');
     if (!func_check($sParentId, 'id')) {
         $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     $oCommentParent = null;
     if ($sParentId != 0) {
         /**
          * Проверяем существует ли комментарий на который отвечаем
          */
         if (!($oCommentParent = $this->Comment_GetCommentById($sParentId))) {
             $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
             return;
         }
         /**
          * Проверяем из одного топика ли новый коммент и тот на который отвечаем
          */
         if ($oCommentParent->getTargetId() != $oTopic->getId()) {
             $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
             return;
//.........这里部分代码省略.........
开发者ID:sergeym,项目名称:livestreet_plugin_guestcomments,代码行数:101,代码来源:ActionGuestcomments.class.php


示例10: EventPagesCheckFields

 /**
  * Проверка полей на корректность
  *
  * @return  bool
  */
 protected function EventPagesCheckFields()
 {
     $this->Security_ValidateSendForm();
     $bOk = true;
     // * Проверяем есть ли заголовок страницы
     if (!func_check(getRequest('page_title'), 'text', 2, 200)) {
         $this->_messageError($this->Lang_Get('page_create_title_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     //  * Проверяем есть ли заголовок страницы, с заменой всех пробельных символов на "_"
     $pageUrl = preg_replace("/\\s+/", '_', getRequest('page_url'));
     $_REQUEST['page_url'] = $pageUrl;
     if (!func_check(getRequest('page_url'), 'login', 1, 50)) {
         $this->_messageError($this->Lang_Get('page_create_url_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     // * Проверяем на плохие/зарезервированные УРЛы
     if (in_array(getRequest('page_url'), $this->aConfig['reserverd_urls'])) {
         $this->_messageError($this->Lang_Get('page_create_url_error_bad') . ' ' . join(',', $this->aConfig['reserverd_urls']), $this->Lang_Get('error'));
         $bOk = false;
     }
     // * Проверяем есть ли содержимое страницы
     if (!func_check(getRequest('page_text'), 'text', 1, 50000)) {
         $this->_messageError($this->Lang_Get('page_create_text_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     // * Проверяем страницу в которую хотим вложить
     if (getRequest('page_pid') != 0 and !($oPageParent = $this->PluginPage_Page_GetPageById(getRequest('page_pid')))) {
         $this->_messageError($this->Lang_Get('page_create_parent_page_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     // * Проверяем сортировку
     if (getRequest('page_sort') and !is_numeric(getRequest('page_sort'))) {
         $this->Message_AddError($this->Lang_Get('page_create_sort_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     // * Выполнение хуков
     $this->Hook_Run('check_page_fields', array('bOk' => &$bOk));
     return $bOk;
 }
开发者ID:olegverstka,项目名称:kprf.dev,代码行数:45,代码来源:ActionAdmin_EventPages.class.php


示例11: checkTopicFields

 /**
  * Проверка полей формы 
  *
  * @return unknown
  */
 protected function checkTopicFields($oTopic = null)
 {
     $this->Security_ValidateSendForm();
     $bOk = true;
     /**
      * Проверяем есть ли блог в кторый постим
      */
     if (!func_check(getRequest('blog_id', null, 'post'), 'id')) {
         $this->Message_AddError($this->Lang_Get('topic_create_blog_error_unknown'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Проверяем есть ли описание вопроса
      */
     if (!func_check(getRequest('topic_text', null, 'post'), 'text', 0, 500)) {
         $this->Message_AddError($this->Lang_Get('topic_question_create_text_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * проверяем заполнение вопроса/ответов только если еще никто не голосовал 
      */
     if (is_null($oTopic) or $oTopic->getQuestionCountVote() == 0) {
         /**
          * Проверяем есть ли заголовок топика(вопрос)
          */
         if (!func_check(getRequest('topic_title', null, 'post'), 'text', 2, 200)) {
             $this->Message_AddError($this->Lang_Get('topic_question_create_title_error'), $this->Lang_Get('error'));
             $bOk = false;
         }
         /**
          * Проверяем варианты ответов
          */
         $aAnswers = getRequest('answer', array());
         foreach ($aAnswers as $key => $sAnswer) {
             if (trim($sAnswer) == '') {
                 unset($aAnswers[$key]);
                 continue;
             }
             if (!func_check($sAnswer, 'text', 1, 100)) {
                 $this->Message_AddError($this->Lang_Get('topic_question_create_answers_error'), $this->Lang_Get('error'));
                 $bOk = false;
                 break;
             }
         }
         $_REQUEST['answer'] = $aAnswers;
         if (count($aAnswers) < 2) {
             $this->Message_AddError($this->Lang_Get('topic_question_create_answers_error_min'), $this->Lang_Get('error'));
             $bOk = false;
         }
         if (count($aAnswers) > 20) {
             $this->Message_AddError($this->Lang_Get('topic_question_create_answers_error_max'), $this->Lang_Get('error'));
             $bOk = false;
         }
     }
     /**
      * Проверяем есть ли теги(метки)
      */
     if (!func_check(getRequest('topic_tags', null, 'post'), 'text', 2, 500)) {
         $this->Message_AddError($this->Lang_Get('topic_create_tags_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * проверяем ввод тегов 
      */
     $sTags = getRequest('topic_tags');
     $aTags = explode(',', rtrim($sTags, "\r\n\t\v ."));
     $aTagsNew = array();
     foreach ($aTags as $sTag) {
         $sTag = trim($sTag);
         if (func_check($sTag, 'text', 2, 50)) {
             $aTagsNew[] = $sTag;
         }
     }
     if (!count($aTagsNew)) {
         $this->Message_AddError($this->Lang_Get('topic_create_tags_error_bad'), $this->Lang_Get('error'));
         $bOk = false;
     } else {
         $_REQUEST['topic_tags'] = join(',', $aTagsNew);
     }
     /**
      * Выполнение хуков
      */
     $this->Hook_Run('check_question_fields', array('bOk' => &$bOk));
     return $bOk;
 }
开发者ID:narush,项目名称:livestreet,代码行数:90,代码来源:ActionQuestion.class.php


示例12: checkTopicFields

 /**
  * Проверка полей формы
  *
  * @return unknown
  */
 protected function checkTopicFields()
 {
     $this->Security_ValidateSendForm();
     $bOk = true;
     /**
      * Проверяем есть ли блог в кторый постим
      */
     if (!func_check(getRequest('blog_id', null, 'post'), 'id')) {
         $this->Message_AddError($this->Lang_Get('topic_create_blog_error_unknown'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Проверяем есть ли заголовок топика
      */
     if (!func_check(getRequest('topic_title', null, 'post'), 'text', 2, 200)) {
         $this->Message_AddError($this->Lang_Get('topic_create_title_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Проверяем есть ли содержание топика
      */
     if (!func_check(getRequest('topic_text', null, 'post'), 'text', 2, Config::Get('module.topic.max_length'))) {
         $this->Message_AddError($this->Lang_Get('topic_create_text_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * Проверяем есть ли теги(метки)
      */
     if (!func_check(getRequest('topic_tags', null, 'post'), 'text', 2, 500)) {
         $this->Message_AddError($this->Lang_Get('topic_create_tags_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * проверяем ввод тегов
      */
     $sTags = getRequest('topic_tags', null, 'post');
     $aTags = explode(',', $sTags);
     $aTagsNew = array();
     $aTagsNewLow = array();
     foreach ($aTags as $sTag) {
         $sTag = trim($sTag);
         if (func_check($sTag, 'text', 2, 50) and !in_array(mb_strtolower($sTag, 'UTF-8'), $aTagsNewLow)) {
             $aTagsNew[] = $sTag;
             $aTagsNewLow[] = mb_strtolower($sTag, 'UTF-8');
         }
     }
     if (!count($aTagsNew)) {
         $this->Message_AddError($this->Lang_Get('topic_create_tags_error_bad'), $this->Lang_Get('error'));
         $bOk = false;
     } else {
         $_REQUEST['topic_tags'] = join(',', $aTagsNew);
     }
     /**
      * Выполнение хуков
      */
     $this->Hook_Run('check_topic_fields', array('bOk' => &$bOk));
     return $bOk;
 }
开发者ID:randomtoy,项目名称:livestreet,代码行数:63,代码来源:ActionTopic.class.php


示例13: EventSetImageTags

 /**
  * Сохраняем теги картинки
  */
 public function EventSetImageTags()
 {
     $sTags = getRequest('tags', null, 'post');
     $aTags = explode(',', $sTags);
     $aTagsNew = array();
     $aTagsNewLow = array();
     foreach ($aTags as $sTag) {
         $sTag = trim($sTag);
         if (func_check($sTag, 'text', 2, 50) and !in_array(mb_strtolower($sTag, 'UTF-8'), $aTagsNewLow)) {
             $aTagsNew[] = $sTag;
             $aTagsNewLow[] = mb_strtolower($sTag, 'UTF-8');
         }
     }
     if (!count($aTagsNew)) {
         $sTags = '';
     } else {
         $sTags = join(',', $aTagsNew);
     }
     /* @var $oImage PluginLsgallery_ModuleImage_EntityImage */
     $oImage = $this->PluginLsgallery_Image_GetImageById(getRequest('id'));
     if ($oImage) {
         /* @var $oAlbum PluginLsgallery_ModuleAlbum_EntityAlbum */
         $oAlbum = $this->PluginLsgallery_Album_GetAlbumById($oImage->getAlbumId());
         if (!$oAlbum || !$this->ACL_AllowAdminAlbumImages($this->oUserCurrent, $oAlbum)) {
             $this->Message_AddError($this->Lang_Get('no_access'), $this->Lang_Get('error'));
             return false;
         }
         $oImage->setImageTags($sTags);
         $this->PluginLsgallery_Image_UpdateImage($oImage);
     }
 }
开发者ID:webnitros,项目名称:ls-plugin_lsgallery,代码行数:34,代码来源:ActionAjax.class.php


示例14: _checkAlbumFields

 /**
  * Validate album fields
  *
  * @param PluginLsgallery_ModuleAlbum_EntityAlbum $oAlbum
  * @return boolean
  */
 protected function _checkAlbumFields($oAlbum = null)
 {
     $this->Security_ValidateSendForm();
     $bOk = true;
     if (!is_null($oAlbum)) {
         if ($oAlbum->getId() != getRequest('album_id')) {
             $this->Message_AddError($this->Lang_Get('plugin.lsgallery.lsgallery_album_id_error'), $this->Lang_Get('error'));
             $bOk = false;
         }
     }
     if (!func_check(getRequest('album_title'), 'text', 2, 64)) {
         $this->Message_AddError($this->Lang_Get('plugin.lsgallery.lsgallery_album_title_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     $sDescription = getRequest('album_description');
     if ($sDescription && !func_check($sDescription, 'text', 10, 512)) {
         $this->Message_AddError($this->Lang_Get('plugin.lsgallery.lsgallery_album_description_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     $aTypes = PluginLsgallery_ModuleAlbum_EntityAlbum::getLocalizedTypes($this);
     if (!in_array(getRequest('album_type'), array_keys($aTypes))) {
         $this->Message_AddError($this->Lang_Get('plugin.lsgallery.lsgallery_album_type_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     return $bOk;
 }
开发者ID:webnitros,项目名称:ls-plugin_lsgallery,代码行数:32,代码来源:ActionGallery.class.php


示例15: PrepareRequest

 /**
  * Подготовка запроса на поиск
  *
  * @return unknown
  */
 private function PrepareRequest()
 {
     $aReq['q'] = getRequest('q');
     if (!func_check($aReq['q'], 'text', 2, 255)) {
         /**
          *  Если запрос слишком короткий перенаправляем на начальную страницу поиска
          * Хотя тут лучше показывать юзеру в чем он виноват
          */
         Router::Location(Router::GetPath('search'));
     }
     $aReq['sType'] = strtolower(Router::GetActionEvent());
     /**
      * Определяем текущую страницу вывода результата
      */
     $aReq['iPage'] = intval(preg_replace('#^page(\\d+)$#', '\\1', $this->getParam(0)));
     if (!$aReq['iPage']) {
         $aReq['iPage'] = 1;
     }
     /**
      *  Передача данных в шаблонизатор 
      */
     $this->Viewer_Assign('aReq', $aReq);
     return $aReq;
 }
开发者ID:narush,项目名称:livestreet,代码行数:29,代码来源:ActionSearch.class.php


示例16: CheckParentComment

 /**
  * Проверка на соответсвие коментария родительскому коментарию
  *
  * @param ModuleTopic_EntityTopic $oTopic
  * @param string $sText
  * @param ModuleComment_EntityComment $oCommentParent
  *
  * @return bool result
  */
 protected function CheckParentComment($oTopic, $sText, $oCommentParent)
 {
     $sParentId = 0;
     if ($oCommentParent) {
         $sParentId = $oCommentParent->GetCommentId();
     }
     $bOk = true;
     /**
      * Проверям на какой коммент отвечаем
      */
     if (!func_check($sParentId, 'id')) {
         $this->Message_AddErrorSingle($this->Lang_Get('common.error.system.base'), $this->Lang_Get('common.error.error'));
         $bOk = false;
     }
     if ($sParentId) {
         /**
          * Проверяем существует ли комментарий на который отвечаем
          */
         if (!$oCommentParent) {
             $this->Message_AddErrorSingle($this->Lang_Get('common.error.system.base'), $this->Lang_Get('common.error.error'));
             $bOk = false;
         }
         /**
          * Проверяем из одного топика ли новый коммент и тот на который отвечаем
          */
         if ($oCommentParent->getTargetId() != $oTopic->getId()) {
             $this->Message_AddErrorSingle($this->Lang_Get('common.error.system.base'), $this->Lang_Get('common.error.error'));
             $bOk = false;
         }
     } else {
         $sParentId = null;
     }
     /**
      * Проверка на дублирующий коммент
      */
     if ($this->Comment_GetCommentUnique($oTopic->getId(), 'topic', $this->oUserCurrent->getId(), $sParentId, md5($sText))) {
         $this->Message_AddErrorSingle($this->Lang_Get('topic.comments.notices.spam'), $this->Lang_Get('common.error.error'));
         $bOk = false;
     }
     $this->Hook_Run('comment_check_parent', array('oTopic' => $oTopic, 'sText' => $sText, 'oCommentParent' => $oCommentParent, 'bOk' => &$bOk));
     return $bOk;
 }
开发者ID:pinguo-liguo,项目名称:livestreet,代码行数:51,代码来源:ActionBlog.class.php


示例17: checkTopicFields

 /**
  * Проверка полей формы 
  *
  * @return unknown
  */
 protected function checkTopicFields($oTopic = null)
 {
     $this->Security_ValidateSendForm();
     $bOk = true;
     /**
      * Проверяем есть ли блог в кторый постим
      */
     if (!func_check(getRequest('blog_id', null, 'post'), 'id')) {
         $this->Message_AddError($this->Lang_Get('topic_create_blog_error_unknown'), $this->Lang_Get('error'));
         $bOk = false;
     }
     if (!func_check(getRequest('topic_text', null, 'post'), 'text', 0, Config::Get('module.topic.max_length'))) {
         $this->Message_AddError($this->Lang_Get('topic_create_text_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * проверяем заполнение вопроса/ответов только если еще никто не голосовал 
      */
     if (is_null($oTopic)) {
         /**
          * Проверяем есть ли заголовок топика
          */
         if (!func_check(getRequest('topic_title', null, 'post'), 'text', 2, 200)) {
             $this->Message_AddError($this->Lang_Get('topic_create_title_error'), $this->Lang_Get('error'));
             $bOk = false;
         }
     }
     /**
      * Проверяем есть ли теги(метки)
      */
     if (!func_check(getRequest('topic_tags', null, 'post'), 'text', 2, 500)) {
         $this->Message_AddError($this->Lang_Get('topic_create_tags_error'), $this->Lang_Get('error'));
         $bOk = false;
     }
     /**
      * проверяем ввод тегов 
      */
     $sTags = getRequest('topic_tags');
     $aTags = explode(',', $sTags);
     $aTagsNew = array();
     foreach ($aTags as $sTag) {
         $sTag = trim($sTag);
         if (func_check($sTag, 'text', 2, 50)) {
             $aTagsNew[] = $sTag;
         }
     }
     if (!count($aTagsNew)) {
         $this->Message_AddError($this->Lang_Get('topic_create_tags_error_bad'), $this->Lang_Get('error'));
         $bOk = false;
     } else {
         $_REQUEST['topic_tags'] = join(',', $aTagsNew);
     }
     $iTopicId = getRequest('topic_id');
     $sTargetId = null;
     $iCountPhotos = 0;
     if (!$oTopic) {
         if (isset($_COOKIE['ls_photoset_target_tmp'])) {
             $iCountPhotos = $this->Topic_getCountPhotosByTargetTmp($_COOKIE['ls_photoset_target_tmp']);
         } else {
             $this->Message_AddError($this->Lang_Get('system_error'), $this->Lang_Get('error'));
             return false;
         }
     } else {
         $iCountPhotos = $this->Topic_getCountPhotosByTopicId($oTopic->getId());
     }
     if ($iCountPhotos < Config::Get('module.topic.photoset.count_photos_min') || $iCountPhotos > Config::Get('module.topic.photoset.count_photos_max')) {
         $this->Message_AddError($this->Lang_Get('topic_photoset_error_count_photos', array('MIN' => Config::Get('module.topic.photoset.count_photos_min'), 'MAX' => Config::Get('module.topic.photoset.count_photos_max'))), $this->Lang_Get('error'));
         return false;
     }
     /**
      * Выполнение хуков
      */
     $this->Hook_Run('check_photoset_fields', array('bOk' => &$bOk));
     return $bOk;
 }
开发者ID:randomtoy,项目名称:livestreet,代码行数:80,代码来源:ActionPhotoset.class.php


示例18: EventUsersInvites

 protected function EventUsersInvites()
 {
     if ($this->GetParam(1) == 'new') {
         $sMode = 'new';
     } else {
         $sMode = 'list';
     }
     $sInviteMode = $this->_getRequestCheck('adm_invite_mode');
     if (!$sInviteMode) {
         $sInviteMode = 'mail';
     }
     $iInviteCount = 0 + intVal(getRequest('invite_count'));
     $aNewInviteList = array();
     $sInviteOrder = getRequest('invite_order');
     $sInviteSort = getRequest('invite_sort');
     if ($this->_getRequestCheck('adm_invite_submit')) {
         if ($sInviteMode == 'text') {
             if ($iInviteCount <= 0) {
                 $this->_messageError($this->Lang_Get('adm_invaite_text_empty'));
             } else {
                 for ($i = 0; $i < $iInviteCount; $i++) {
                     $oInvite = $this->User_GenerateInvite($this->oUserCurrent);
                     $aNewInviteList[$i + 1] = $oInvite->GetCode();
                 }
                 $this->_messageNotice($this->Lang_Get('ad 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP func_fill_day函数代码示例发布时间:2022-05-15
下一篇:
PHP func_camelize函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap