/**
  * @see Event::SEARCH_TYPE
  */
 public function search_type($params)
 {
     $query = $params['query'];
     $project = $query->getProject();
     if ($query->getTypeOfSearch() == $this->name && $this->isSearchEntryAvailable($project)) {
         if (!$project->isError()) {
             util_return_to($this->getMediawikiSearchURI($project, $query->getWords()));
         }
     }
 }
Esempio n. 2
0
     if (db_numrows($result) == 0) {
         // there is not any language specified for this wiki, default search page is english
         $search_page = 'FullTextSearch';
     } else {
         $language_id = db_fetch_array($result);
         //Build the search pagename in the wiki language
         if ($language_id[0] == 'en_US') {
             $search_page = 'FullTextSearch';
         } else {
             if ($language_id[0] == 'fr_FR') {
                 $search_page = 'RechercheEnTexteIntégral';
             }
         }
     }
     $GLOBALS['sys_force_ssl'] = 1;
     util_return_to('/wiki/index.php?group_id=' . $group_id . '&pagename=' . $search_page . '&s=' . urlencode($_REQUEST['words']));
 } else {
     $matchingSearchTypeFound = false;
     $rows_returned = 0;
     $rows = 0;
     $eParams = array();
     $eParams['words'] = $_REQUEST['words'];
     $eParams['offset'] = $offset;
     $eParams['nbRows'] = 25;
     $eParams['type_of_search'] = $type_of_search;
     $eParams['search_type'] =& $matchingSearchTypeFound;
     $eParams['rows_returned'] =& $rows_returned;
     $eParams['rows'] =& $rows;
     $em =& EventManager::instance();
     $em->processEvent('search_type', $eParams);
     if (!$matchingSearchTypeFound) {
Esempio n. 3
0
//
//
header("Expires: Wed, 11 Nov 1998 11:11:11 GMT");
header("Cache-Control: no-cache, no-store, must-revalidate");
require_once 'pre.php';
require_once 'account.php';
require_once 'common/include/CookieManager.class.php';
require_once 'common/user/LoginController.class.php';
$login_controller = new User_LoginController($request);
if ($request->get('confirm_hash')) {
    $login_controller->confirmHash();
}
$em =& EventManager::instance();
if (!session_issecure() && isset($GLOBALS['sys_https_host']) && $GLOBALS['sys_https_host'] != "") {
    //force use of SSL for login
    util_return_to('https://' . $GLOBALS['sys_https_host'] . '/account/login.php');
    exit;
}
//
// Validate input
//
// Clean variables
$_cVar = array();
// Raw variables
$_rVar = array();
$request =& HTTPRequest::instance();
$_rVar['form_loginname'] = null;
if ($request->valid(new Valid_String('form_loginname'))) {
    $_rVar['form_loginname'] = $request->get('form_loginname');
}
$_rVar['form_pw'] = null;
Esempio n. 4
0
 function before_register($params)
 {
     if ($GLOBALS['sys_auth_type'] == 'ldap' && !$this->hasLDAPWrite()) {
         if (isset($GLOBALS['sys_https_host']) && $GLOBALS['sys_https_host'] != "") {
             $host = 'https://' . $GLOBALS['sys_https_host'];
         } else {
             $host = 'http://' . $GLOBALS['sys_default_domain'];
         }
         util_return_to($host . '/account/login.php');
     }
 }
Esempio n. 5
0
 public function search_type($params)
 {
     $query = $params['query'];
     if ($query->getTypeOfSearch() == self::SEARCH_TYPE) {
         $request = HTTPRequest::instance();
         $list = (int) $request->get('list');
         util_return_to($this->getSearchUrl($query->getProject()->getId(), $list, $query->getWords()));
     }
 }
Esempio n. 6
0
 function redirectToLogin($params)
 {
     if ($GLOBALS['sys_auth_type'] == 'ldap') {
         if (isset($GLOBALS['sys_https_host']) && $GLOBALS['sys_https_host'] != "") {
             $host = 'https://' . $GLOBALS['sys_https_host'];
         } else {
             $host = 'http://' . $GLOBALS['sys_default_domain'];
         }
         util_return_to($host . '/account/login.php');
     }
 }
Esempio n. 7
0
function account_redirect_after_login()
{
    global $pv;
    $em =& EventManager::instance();
    $em->processEvent('account_redirect_after_login', null);
    $request = HTTPRequest::instance();
    if ($request->existAndNonEmpty('return_to')) {
        $returnToToken = parse_url($request->get('return_to'));
        if (preg_match('{/my(/|/index.php|)}i', $returnToToken['path'])) {
            util_return_to('/my/index.php');
        } else {
            util_return_to('/my/redirect.php');
        }
    } else {
        if (isset($pv) && $pv == 2) {
            util_return_to('/my/index.php?pv=2');
        } else {
            util_return_to('/my/index.php');
        }
    }
}
Esempio n. 8
0
 function search_type($params)
 {
     if (isset($params['type_of_search']) && $params['type_of_search'] == 'mail') {
         $request =& HTTPRequest::instance();
         $group_id = (int) $request->get('group_id');
         $list = (int) $request->get('list');
         util_return_to('/plugins/forumml/message.php?group_id=' . $group_id . '&list=' . $list . '&search=' . urlencode($params['words']));
     }
 }