00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 require_once 'diogenes.page.inc.php';
00023 require_once 'Barrel/Options.php';
00024
00027 class DiogenesToplevel extends DiogenesPage {
00028
00033 function DiogenesToplevel($admin = false)
00034 {
00035
00036 $this->DiogenesPage();
00037 $this->makeHead();
00038 $this->assign('site',"Diogenes");
00039 $this->assign('page', $admin ? __("Toplevel administration") : __("Home"));
00040
00041
00042 $this->startSession();
00043
00044
00045 if (isset($_REQUEST['dologout']))
00046 $this->doLogout();
00047
00048
00049 if ($admin || isset($_REQUEST['doauth']))
00050 $_SESSION['session']->doAuth($this);
00051
00052 if ($admin && !$_SESSION['session']->hasPerms("root"))
00053 $this->kill(__("You are not authorized to view this page!"), 403);
00054 }
00055
00056
00057
00060 function makeHead()
00061 {
00062 array_push($this->head, '<meta name="description" content="Diogenes content management system" />');
00063 array_push($this->head, '<meta name="keywords" content="Diogenes, Polytechnique.org, Jeremy Lainé" />');
00064 array_push($this->head, '<link rel="stylesheet" href="'.$this->url("common.css").'" type="text/css" />');
00065 array_push($this->head, '<link rel="stylesheet" href="'.$this->url("toplevel.css").'" type="text/css" />');
00066 array_push($this->head, '<link rel="icon" href="'.$this->url("images/favicon.png").'" type="image/png" />');
00067 }
00068
00069
00072 function makeMenu()
00073 {
00074 global $globals;
00075
00076
00077 $this->assign('menustyle', $globals->menu_style);
00078 $this->assign('menutheme', $globals->menu_theme);
00079
00080
00081 array_push($this->menu, array(0,"Diogenes", "", 1));
00082 array_push($this->menu, array(1,__("Home"), $this->url("")));
00083 array_push($this->menu, array(1,__("User manual"), __("http://diogenes-doc.polytechnique.org/en-user/")) );
00084
00085 if ($this->isLogged()) {
00086 array_push($this->menu, array(1,__("Preferences"),$this->url("prefs.php")) );
00087 array_push($this->menu, array(1,__("Logout"), $this->url("?dologout=1")) );
00088 } else {
00089 array_push($this->menu, array(1,__("Login"), $this->url("?doauth=1")) );
00090 }
00091 if ($this->isRoot()) {
00092 array_push($this->menu, array(0,__("Sites"), "", 1));
00093 array_push($this->menu, array(1, __("Root manual"), __("http://diogenes-doc.polytechnique.org/en-root/")) );
00094 array_push($this->menu, array(1,__("List of sites"), $this->url("toplevel/")) );
00095 array_push($this->menu, array(1,__("Administrators"),$this->url("toplevel/admins.php")) );
00096 array_push($this->menu, array(1,__("Global options"),$this->url("toplevel/options.php")) );
00097 array_push($this->menu, array(1,__("Plugins"),$this->url("toplevel/plugins.php")));
00098 array_push($this->menu, array(0,__("Users"), "", 1));
00099 array_push($this->menu, array(1,__("User accounts"),$this->url("toplevel/accounts.php")) );
00100 array_push($this->menu, array(1,__("Browse user log"),$this->url("toplevel/logger.php")) );
00101 array_push($this->menu, array(1,__("Logger actions"),$this->url("toplevel/logger_actions.php")) );
00102 }
00103 }
00104
00105 }
00106
00107 ?>