コード例 #1
0
$uid = $this->LoggedInId();
if ($uid) {
    // get the member groups.
    $t1 = $this->GetMemberGroups($uid);
    if (is_array($t1)) {
        // user is a member of at least one group
        $membergroups = array();
        foreach ($t1 as $row) {
            $membergroups[] = $row['groupid'];
        }
        // test membership.
        $t1 = explode(',', $feu_groups);
        if (in_array($t1, '-1')) {
            // any group will do.
            $passed = true;
        } else {
            $tmp = array_intersect($membergroups, $t2);
            if (is_array($tmp) && count($tmp) > 0) {
                $passed = true;
            }
        }
    }
}
if (!$passed) {
    if ($feu_redirect != -1) {
        redirect_to_alias($feu_redirect);
    }
}
#
# EOF
#
コード例 #2
0
function smarty_cms_function_redirect_page($params, &$smarty)
{
    if (isset($params['page'])) {
        redirect_to_alias(trim($params['page']));
    }
}
コード例 #3
0
 /**
  * Redirects the user to a content page outside of the module.	The passed around returnid is
  * frequently used for this so that the user will return back to the page from which they first
  * entered the module.
  *
  * @param string Content id to redirect to.
  * @return void
  */
 function RedirectContent($id)
 {
     redirect_to_alias($id);
 }
コード例 #4
0
 public function Show($param = '')
 {
     if (!$this->_isAuthorized()) {
         $feu = cms_utils::get_module('FrontEndUsers');
         $action = $feu->GetPreference('pagetype_action', 'showlogin');
         // now what do we do.
         switch ($action) {
             case 'redirect':
                 $page = $feu->GetPreference('pagetype_redirectto', -1);
                 if ($page == -1) {
                     return $feu->Lang('pagetype_unauthorized');
                 } else {
                     redirect_to_alias($page);
                 }
                 break;
             case 'showlogin':
             default:
                 return $feu->DoAction('default', 'cntnt01', array('form' => 'login'), $this->Id());
                 break;
         }
     }
     return parent::Show();
 }
コード例 #5
0
function smarty_function_redirect_page($params, &$template)
{
    if (isset($params['page'])) {
        redirect_to_alias(trim($params['page']));
    }
}