Ejemplo n.º 1
0
 /**
  * Хук инициализации формы
  *
  * @param type $Form
  */
 public function hookFormLoad($Form)
 {
     if (access('Parser.off')) {
         if ($this->input->post('parser_off')) {
             Cookie::set('parser_off', TRUE);
         }
         if ($Form->body) {
             $Form->add('parser_off', array('type' => 'checkbox', 'label' => t('Отключить парсер'), 'value' => Cookie::get('parser_off') ? TRUE : FALSE, 'order' => $Form->body->options->order . '.1'));
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * 
  * @param type $menu
  * @param type $id
  */
 public static function getPagesForMenu($menu, $id)
 {
     $pages = Page::where('parent', '=', $id)->get(['id', 'menu', 'parent', 'title']);
     if ($id == 0) {
         foreach ($pages as $page) {
             $menu->add($page->menu, array('route' => array('oldalak.show', 'id' => $page->id, 'title' => Str::slug($page->title))));
             Page::getPagesForMenu($menu, $page->id);
         }
     } else {
         foreach ($pages as $page) {
             $parent = Page::find($page->parent);
             $menu->get(Str::camel($parent->menu))->add($page->menu, array('route' => array('oldalak.show', 'id' => $page->id, 'title' => Str::slug($page->title))));
             Page::getPagesForMenu($menu, $page->id);
         }
     }
 }
Ejemplo n.º 3
0
 /** Get the date and time and add one hour
  * @access public
  * @return array
  */
 public function getDate()
 {
     $this->_date = new Zend_Date();
     $this->_date->add('1', Zend_Date::HOUR)->toString('YYYY-MM-dd HH:mm:ss');
     return $this->_date;
 }
Ejemplo n.º 4
0
 /**
  * Adds html snippet to menu
  * Snippet coresponds to selected operation in context menu 
  * All create***MenuItem method must be implemented by descendant classes
  * @param string $operationName
  * @param type $menu
  * @param type $mediaTrigger
  * @param type $folderItem
  */
 private function _addOperationToMenu($operationName, &$menu, $mediaTrigger, $folderItem)
 {
     switch ($operationName) {
         case 'editTitles':
             $menu->add($this->createTitlesMenuItem($folderItem));
             break;
         case 'renameFile':
             $menu->add($this->createRenameMenuItem($folderItem));
             break;
         case 'insertFile':
             $menu->add($this->createInsertFileToContainerMenuItem($folderItem));
             break;
         case 'deleteFile':
             $menu->add($this->createDeleteFileMenuItem($folderItem));
             break;
         case 'cutFile':
             $menu->add($this->createCutFileMenuItem($folderItem));
             break;
         case 'toggleSelectFile':
             $menu->add($this->createToggleSelectFileMenuItem($folderItem));
             break;
         case 'renameFolder':
             $menu->add($this->createRenameFolderMenuItem($folderItem));
             break;
         case 'deleteFolder':
             $menu->add($this->createDeleteFolderMenuItem($folderItem));
             break;
         case 'cutFolder':
             $menu->add($this->createCutFolderMenuItem($folderItem));
             break;
         case 'renameGallery':
             $menu->add($this->createRenameGalleryMenuItem($folderItem));
             break;
         case 'deleteGallery':
             $menu->add($this->createDeleteGalleryMenuItem($folderItem));
             break;
         case 'insertGallery':
             $menu->add($this->createInsertGalleryMenuItem($mediaTrigger, $folderItem));
             break;
         case 'cutGallery':
             $menu->add($this->createCutGalleryMenuItem($folderItem));
             break;
         case 'sep':
             $menu->add($this->createMenuSeparator());
             break;
     }
 }
Ejemplo n.º 5
0
/**
 * Validate password resets for banned users
 *
 * @param type $errors
 * @param type $user_obj
 */
function umc_wp_password_reset_check($errors, $user_obj)
{
    XMPP_ERROR_trace(__FUNCTION__, func_get_args());
    require_once '/home/minecraft/server/bin/index_wp.php';
    $check = umc_user_is_banned($user_obj->user_login);
    if ($check) {
        // user is banned
        $errors->add('user_is_banned', 'ERROR: You are banned from this server. Password request denied.');
        XMPP_ERROR_send_msg("Banned User " . $user_obj->user_login . " attempted password reset");
    }
}
Ejemplo n.º 6
0
 public function addProjets(Projet $projet)
 {
     if (!$this->projets->contains($projet)) {
         $this->projets->add($projet);
         $projet->setProfile($this);
     }
     return $this;
 }
Ejemplo n.º 7
0
/**
 * Validates security question
 *
 * @param type $user_name
 * @param type $user_email
 * @param type $errors
 */
function wangguard_signup_validate($user_name, $user_email, $errors)
{
    //if ($_POST['user_email']){ $user_email = $_POST['user_email']; }else{ $user_email = $user_email; }
    $wggstopcheck = false;
    do_action('pre_wangguard_validate_signup_form_wordpress_no_multisite', $user_email);
    $wggstopcheck = apply_filters('pre_wangguard_validate_signup_form_wordpress_no_multisite', $wggstopcheck);
    if (!$wggstopcheck) {
        if (!wangguard_validate_hfields($user_email)) {
            $errors->add('user_login', __('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is it an error?</a> Perhaps you tried to register many times.', 'wangguard'));
            return;
        }
        $answerOK = wangguard_question_repliedOK();
        //If at least a question exists on the questions table, then check the provided answer
        if (!$answerOK) {
            $errors->add('wangguard_error', __('<strong>ERROR</strong>: The answer to the security question is invalid.', 'wangguard'));
        } else {
            //check domain against the list of selected blocked domains
            $blocked = wangguard_is_domain_blocked($user_email);
            if ($blocked) {
                $errors->add('wangguard_error', __('<strong>ERROR</strong>: Domain not allowed.', 'wangguard'));
            } else {
                $reported = wangguard_is_email_reported_as_sp($user_email, wangguard_getRemoteIP(), wangguard_getRemoteProxyIP(), true);
                if ($reported) {
                    $errors->add('wangguard_error', __('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is it an error?</a> Perhaps you tried to register many times.', 'wangguard'));
                } else {
                    if (wangguard_email_aliases_exists($user_email)) {
                        $errors->add('wangguard_error', __('<strong>ERROR</strong>: Duplicate alias email found by WangGuard.', 'wangguard'));
                    } else {
                        if (!wangguard_mx_record_is_ok($user_email)) {
                            $errors->add('wangguard_error', __("<strong>ERROR</strong>: WangGuard couldn't find an MX record associated with your email domain.", 'wangguard'));
                        }
                    }
                }
            }
        }
    }
}
 /**
  * Constructor del shortcode per a llistes.
  *
  * @param type $shortcodes_handler gestiona les URL.
  */
 public function __construct($shortcodes_handler = null)
 {
     if ($shortcodes_handler != null) {
         $shortcodes_handler->add('llista-icones', array($this, 'shortcode'), true);
     }
 }
Ejemplo n.º 9
0
 /**
  * Добавлени пункта в админ меню
  *
  * @param type $menu
  */
 public function hookMenuAdmin($menu)
 {
     $menu->add(array('label' => icon('fire') . ' ' . t('Код'), 'link' => l('/admin/code'), 'order' => 555));
 }
Ejemplo n.º 10
0
 public function addValidator($validator)
 {
     $this->validators->add($validator);
 }
Ejemplo n.º 11
0
/**
 * Validates security question
 * 
 * @param type $user_name
 * @param type $user_email
 * @param type $errors
 */
function wangguard_signup_validate($user_name, $user_email, $errors)
{
    if (!wangguard_validate_hfields($_POST['user_email'])) {
        $errors->add('user_login', __('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is a mistake?</a>.', 'wangguard'));
        return;
    }
    $answerOK = wangguard_question_repliedOK();
    //If at least a question exists on the questions table, then check the provided answer
    if (!$answerOK) {
        $errors->add('wangguard_error', __('<strong>ERROR</strong>: The answer to the security question is invalid.', 'wangguard'));
    } else {
        //check domain against the list of selected blocked domains
        $blocked = wangguard_is_domain_blocked($_REQUEST['user_email']);
        if ($blocked) {
            $errors->add('wangguard_error', __('<strong>ERROR</strong>: Domain not allowed.', 'wangguard'));
        } else {
            $reported = wangguard_is_email_reported_as_sp($_REQUEST['user_email'], wangguard_getRemoteIP(), wangguard_getRemoteProxyIP(), true);
            if ($reported) {
                $errors->add('wangguard_error', __('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is a mistake?</a>.', 'wangguard'));
            } else {
                if (wangguard_email_aliases_exists($_REQUEST['user_email'])) {
                    $errors->add('wangguard_error', __('<strong>ERROR</strong>: Duplicate alias email found by WangGuard.', 'wangguard'));
                } else {
                    if (!wangguard_mx_record_is_ok($_REQUEST['user_email'])) {
                        $errors->add('wangguard_error', __("<strong>ERROR</strong>: WangGuard couldn't find an MX record associated with your email domain.", 'wangguard'));
                    }
                }
            }
        }
    }
}