Alternc  latest
Alternc logiel libre pour l'hébergement
webmail-redirect.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Redirect the user to the best possible webmail url
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config_nochk.php");
27 
28 
29 $res=$hooks->invoke("hook_admin_webmail");
30 if (($wr=variable_get("webmail_redirect")) && isset($res[$wr]) && $res[$wr]) {
31  $url=$res[$wr];
32 } else {
33  foreach($res as $r) if ($r!==false) { $url=$r; break; }
34 }
35 if (isset($url) && $url) {
36  header("Location: $url");
37 } else {
38  header("Location: /nowebmail");
39 }
40 
$hooks
Definition: bootstrap.php:74
$r
Definition: aws_add.php:75
variable_get($name, $default=null, $createit_comment=null)
Return a persistent variable.
Definition: variables.php:85
$res
Redirect the user to the best possible webmail url.