summaryrefslogblamecommitdiffstats
path: root/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml
blob: f8096b254f5fc1b1dd593bdc9491f8dfa2b7e75d (plain) (tree)
1
2
3
4
5
6
     

             
  
                             
                                   













                                                                 
                               
                
                                    

   





                                          
                         

                              



                                                                               



                                





                                  
                                    
                                      
                                                                                                     

   
                             
                                    
                                                                              
                                                                                                     

   
                                              
                                      
                                                                                         

   
                                             
                                                                                           
                                                                                         

   
                          
                                            

   

  
                                             
                                                                

                
                          
 
                              
















                                                                
                                                                
                                                                        

                                                                
                                                                











                                                                 




                               
                                                                     

                               
                                                                      

                              
                                              







                                                                   
                                                                                                                                                                                                         
                         
                                         
                                                                                       
                                                                                                                                        
                      
                                                     


                 
                                                



















                                                                                                                                                                                                                                                                                                                                                    
                                 


                                                  
                                                                                                    

                                                                    
                                                                                                             
                                                                                                                                          
                                                                                                                                        



                            
   
  
<?php
  
  $index = 0;
  
  function title ( $title ) {
    echo "menu title ".$title."\n";
  }
  
  function label ( $label ) {
    global $index;
    $index++;
    echo "label item".$index."\n";
    echo "  menu label ";
    echo "^".( ( $index < 10 ) ? $index :
               sprintf ( "%c", $index + ord ( 'A' ) - 10 ) )." ";
    echo $label."\n";
  }
  
  function uriboot ( $label, $uri, $args ) {
    label ( $label );
    echo "  kernel ".$uri."\n";
    if ( $args )
        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";
  	texthelp("Gets you out of here by booting from next device in BIOS boot
         order.");
  }
  
  function separator(){
  	echo "MENU SEPARATOR\n";
  }
  
  function texthelp ( $texthelp ){
  	echo "TEXT HELP\n";
	echo $texthelp."\n";
	echo "ENDTEXT\n";
  }
  
  function nomembership ($alphaID) {
    title ("You have no memberships");
    uriboot ( "Return to Group Bootmenu", "/ipxe/vesamenu.c32", "/ipxe/auth/logout/alpha/$alphaID" );
  }
  
  function retry ($alphaID) {
    title ("Authentication Failed");
    uriboot ( "Try again", "/ipxe/auth/login/alpha/$alphaID/login/true", "" );
    uriboot ( "Return to Group Bootmenu", "/ipxe/vesamenu.c32", "/ipxe/auth/logout/alpha/$alphaID" );
  }
  
  function sessionerror ($serialnumber,$mac) {
    title ("A Session Error occured");
    uriboot ( "Reconnect", "/ipxe/auth/serial/serialnumber/$serialnumber/mac/$mac", "" );
  }
  
  function serialerror ($serialnumber,$mac) {
    title ("The Serial was not found. Press Tab to change the Serial or contact an Admin");
    uriboot ( "Reconnect", "/ipxe/auth/serial/serialnumber/$serialnumber/mac/$mac", "" );
  }
  
  function nobootmenu () {
    title ("There are no Bootmenu Entries");
  }
  
?>
  
<?php if($this->action != "selectmembership")
		echo "TIMEOUT ".(10*$this->startcounter)."\n";?>
		
PROMPT 0
DEFAULT /ipxe/vesamenu.c32

MENU BACKGROUND /ipxe/pbs2.png
MENU WIDTH 78
MENU MARGIN 9
MENU PASSWORDMARGIN 9
MENU ROWS 10
MENU TABMSGROW 16
MENU CMDLINEROW 16
MENU ENDROW -1
MENU PASSWORDROW 16
MENU TIMEOUTROW 20
MENU HELPMSGROW 16
MENU HELPMSGENDROW -1
MENU HSHIFT 0
MENU VSHIFT 7

#menu color screen       37;40           #80ffffff #00000000 std
menu color border        37;40           #00000000 #00000000 std
menu color title         1               #ee004a99 #00000000 all
menu color unsel         37;40           #ff4f75aa #00000000 all
menu color hotkey        1 		         #ffff8b00 #00000000 std
menu color sel           7;37;40         #ff1c2a33 #667799bb all
#menu color hotsel       1;7;37;40       #ffff8b00 #667799bb all
menu color disabled     1;37;40          #ff4f75aa #00000000 std
#menu color scrollbar    37;40           #40000000 #ee000000 std
#menu color tabmsg       37;40           #ffff8b00 #ff8093a1 std
#menu color cmdmark      1;37;40         #ffff8b00 #ff8093a1 std
#menu color cmdline      37;40           #fff0f0f0 #ff8093a1 std
#menu color pwdborder    37;40           #40000000 #ff8093a1 std
#menu color pwdheader    37;40           #ffff8b00 #ff8093a1 std
#menu color pwdentry     37;40           #ffff8b00 #ff8093a1 std
#menu color timeout_msg  37;40           #fff0f0f0 #ff8093a1 std
#menu color timeout      1;37;40         #ffff8b00 #ff8093a1 std
#menu color help         37;40           #ff1c2a33 #00000000 none
MENU MSGCOLOR                            #ff1c2a33 #00000000 none

<?php

  if(isset($this->error)){
	  switch($this->error){
	  	case "serial": 
	  		serialerror($this->serialnumber, $this->mac);
	  		break;
	  	case "session":
	  		sessionerror($this->serialnumber, $this->mac);
	  		break;
	  	case "login":
	  		retry($this->alphaID);
	  		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/vesamenu.c32", "/ipxe/auth/setgroup/membershipid/".$membership['membershipID']."/alpha/$this->alphaID");
	  		}
	  		comment ("", "");
	  		comment ("login", "Logged-In as $this->firstname $this->name");
	  		uriboot ( "Logout (Return to Group Bootmenu)", "/ipxe/vesamenu.c32", "/ipxe/auth/logout/alpha/$this->alphaID" );
	  	}else{
	  		nomembership($this->alphaID);
	  	}
	  }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 ("", "");
	  	comment ("info", "More Options:");
	  	
	  	if(!$this->loggedin){
	  		uriboot ( "Login", "/ipxe/auth/login/alpha/$this->alphaID/login/true", "" );
	  		texthelp("Login to get your own Bootmenu.");
	  	}else{
	  		comment ("login", "Logged-In as $this->firstname $this->name in Group $this->group");
	  		uriboot ( "Switch Group From $this->group", "/ipxe/vesamenu.c32", "/ipxe/auth/switchgroup/alpha/$this->alphaID" );
	  		uriboot ( "Logout (Return to Group Bootmenu)", "/ipxe/vesamenu.c32", "/ipxe/auth/logout/alpha/$this->alphaID" );
	  	}
	  	
	  	localboot();
	  }
  }