diff options
| author | michael pereira | 2011-09-26 02:25:32 +0200 |
|---|---|---|
| committer | michael pereira | 2011-09-26 02:25:32 +0200 |
| commit | c96879951fec2354af5f1c0183a0f941099f0caa (patch) | |
| tree | 8de146fe1efa9e5970df85d2d187f681b9b2e3cb /application/modules/ipxe/views | |
| parent | nomembership (diff) | |
| download | pbs2-c96879951fec2354af5f1c0183a0f941099f0caa.tar.gz pbs2-c96879951fec2354af5f1c0183a0f941099f0caa.tar.xz pbs2-c96879951fec2354af5f1c0183a0f941099f0caa.zip | |
menues ueberarbeitet
Diffstat (limited to 'application/modules/ipxe/views')
| -rw-r--r-- | application/modules/ipxe/views/scripts/resource/getvesamenu.phtml | 157 |
1 files changed, 87 insertions, 70 deletions
diff --git a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml index 776a810..7755c54 100644 --- a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml +++ b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml @@ -23,6 +23,12 @@ echo " append ".$args."\n"; } + function comment ( $label, $labelmenu) { + echo "label $label\n"; + echo " menu label $labelmenu\n"; + echo " menu disable\n"; + } + function localboot () { label ( "LOCALBOOT"); echo "LOCALBOOT -1\n"; @@ -37,32 +43,32 @@ } function nomembership () { - echo "label failed\n"; - echo " menu label You have no memberships\n"; - echo " menu disable\n"; - uriboot ( "Return to Group Bootmenu", "/ipxe/auth/serial/serialnumber/55-44-33-22-11/mac/123/login/false", "" ); + comment ("failed", "You have no memberships"); + uriboot ( "Return to Group Bootmenu", "/ipxe/auth/logout/alpha/$this->alphaID", "" ); } function retry () { - echo "label failed\n"; - echo " menu label Authentication Failed\n"; - echo " menu disable\n"; - uriboot ( "Try again", "/ipxe/auth/serial/serialnumber/55-44-33-22-11/mac/123/login/true", "" ); - uriboot ( "Return to Group Bootmenu", "/ipxe/auth/serial/serialnumber/55-44-33-22-11/mac/123/login/false", "" ); + comment ("failed", "Authentication Failed"); + uriboot ( "Try again", "/ipxe/auth/login/alpha/$this->alphaID", "" ); + uriboot ( "Return to Group Bootmenu", "/ipxe/auth/logout/alpha/$this->alphaID", "" ); + } + + function sessionerror () { + comment ("failed", "A Session Error occured"); + uriboot ( "Reconnect", "/ipxe/auth/serial/serialnumber/$this->serialnumber/mac/$this->mac", "" ); + } + + function serialerror () { + comment ("failed", "The Serial was not found. Press Tab to change the Serial or contact an Admin"); + uriboot ( "Reconnect", "/ipxe/auth/serial/serialnumber/$this->serialnumber/mac/$this->mac", "" ); } - function authenticated ($username, $password) { - - switch ( "$username:$password" ) { - case "test:test": - case "guest:guest": - return 1; - default: - return 0; - } + function nobootmenu () { + comment ("failed", "There are no Bootmenu Entries"); } - ?> +?> + TIMEOUT 100 PROMPT 0 @@ -101,56 +107,67 @@ menu color sel 7;37;40 #ff1c2a33 #667799bb all #menu color help 37;40 #ff1c2a33 #00000000 none MENU MSGCOLOR #ff1c2a33 #00000000 none - <? -// if(!isset($this->error)){ -// title ( $this->title ); -// }else{ -// title($this->error); -// } - - if($this->action == "selectmembership"){ - title ( "Select Membership:" ); - if(isset($this->memberships)){ - foreach($this->memberships as $membership){ - uriboot ($membership['group']." as ".$membership['role'], 'test', 'test'); - } - - }else{ - nomembership(); - } - +<?php + + if(isset($this->error)){ + switch($this->error){ + case "serial": + serialerror(); + break; + case "session": + sessionerror(); + break; + case "login": + retry(); + break; + } + }else{ + + if($this->action == "selectmembership"){ + title ( "Select Membership:" ); + if(isset($this->memberships)){ + foreach($this->memberships as $membership){ + uriboot ($membership['group']." as ".$membership['role'], "/ipxe/auth/setgroup/membershipid/".$membership['membershipID']."/alpha/$this->alphaID", ''); + } + uriboot ( "Return to Group Bootmenu", "/ipxe/auth/logout/alpha/$this->alphaID", "" ); + }else{ + nomembership(); + } + }else{ + + title ( $this->title ); + + $bootosmapper = new Application_Model_BootOsMapper(); + + if(isset($this->bmelist)){ + foreach($this->bmelist as $bme){ + + $kcl = $bootosmapper->find($bme->getBootosID())->getDefaultkcl(); + + if($bme->getKcl() && $kcl != null){ + uriboot ( $bme->getTitle(), + "http://$this->host/ipxe/resource/getkernel/alpha/$this->alphaID/bme/".$bme->getID()."/file/kernel", "initrd=http://$this->host/ipxe/resource/getinitramfs/alpha/$this->alphaID/bme/".$bme->getID()."/file/initramfs $kcl alpha=$this->alphaID file=http://$this->host/c/$this->alphaID/default.tgz ".$bme->getKclappend()); + }else{ + uriboot ( $bme->getTitle(), + "http://$this->host/ipxe/resource/getkernel/alpha/$this->alphaID/bme/".$bme->getID()."/file/kernel", "initrd=http://$this->host/ipxe/resource/getinitramfs/alpha/$this->alphaID/bme/".$bme->getID()."/file/initramfs alpha=$this->alphaID file=http://$this->host/c/$this->alphaID/default.tgz ".$bme->getKclappend()); + } + } + }else{ + nobootmenu(); + } + + comment ("info", "More Options:"); + + if(!$this->loggedin){ + uriboot ( "Login", "/ipxe/auth/login/alpha/$this->alphaID", "" ); + texthelp("Login to get your own Bootmenu."); + }else{ + uriboot ( "Switch Group From $this->group", "/ipxe/auth/switchgroup/alpha/$this->alphaID", "" ); + uriboot ( "Return to Group Bootmenu $this->group", "/ipxe/auth/logout/alpha/$this->alphaID", "" ); + } + + localboot(); + } } - -// if (!$this->login) { -// retry(); -// } else { -// -// $bootosmapper = new Application_Model_BootOsMapper(); -// -// if(isset($this->bmelist)){ -// foreach($this->bmelist as $bme){ -// -// $kcl = $bootosmapper->find($bme->getBootosID())->getDefaultkcl(); -// -// if($bme->getKcl() && $kcl != null){ -// uriboot ( $bme->getTitle(), -// "http://$this->host/ipxe/resource/getkernel/alpha/$this->alphaID/bme/".$bme->getID()."/file/kernel", "initrd=http://$this->host/ipxe/resource/getinitramfs/alpha/$this->alphaID/bme/".$bme->getID()."/file/initramfs $kcl alpha=$this->alphaID file=http://$this->host/c/$this->alphaID/default.tgz ".$bme->getKclappend()); -// }else{ -// uriboot ( $bme->getTitle(), -// "http://$this->host/ipxe/resource/getkernel/alpha/$this->alphaID/bme/".$bme->getID()."/file/kernel", "initrd=http://$this->host/ipxe/resource/getinitramfs/alpha/$this->alphaID/bme/".$bme->getID()."/file/initramfs alpha=$this->alphaID file=http://$this->host/c/$this->alphaID/default.tgz ".$bme->getKclappend()); -// } -// } -// if($this->login) -// uriboot ( "Return to Group Bootmenu", "/ipxe/auth/serial/serialnumber/55-44-33-22-11/mac/123/login/false", "" ); -// } -// -// if(!$this->login){ -// uriboot ( "Login", "/ipxe/auth/serial/serialnumber/55-44-33-22-11/mac/123/login/true", "" ); -// texthelp("Login to get your own Bootmenu."); -// } -// -// localboot(); -// } - - ?>
\ No newline at end of file +?>
\ No newline at end of file |
