diff options
| author | michael pereira | 2011-07-11 00:51:43 +0200 |
|---|---|---|
| committer | michael pereira | 2011-07-11 00:51:43 +0200 |
| commit | e01348134e7d44de9471c4d76659cab41a6c9952 (patch) | |
| tree | bba0e9343e6b7ed80fd57b7623fef01ae481357f /application/modules/ipxe/views/scripts | |
| parent | Session fuer ipxe (diff) | |
| download | pbs2-e01348134e7d44de9471c4d76659cab41a6c9952.tar.gz pbs2-e01348134e7d44de9471c4d76659cab41a6c9952.tar.xz pbs2-e01348134e7d44de9471c4d76659cab41a6c9952.zip | |
Session und Filter fuer ipxe Bootmenu
Diffstat (limited to 'application/modules/ipxe/views/scripts')
| -rw-r--r-- | application/modules/ipxe/views/scripts/resource/getvesamenu.phtml | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml new file mode 100644 index 0000000..cb440cb --- /dev/null +++ b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml @@ -0,0 +1,157 @@ +<?php + +// $username = $_SERVER["PHP_AUTH_USER"]; +// $password = $_SERVER["PHP_AUTH_PW"]; + + $index = 0; + + function title ( $title ) { + global $username; + echo "menu title ".$title; + echo ( $username ? " for ".$username : "" )."\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 localboot () { + label ( "LOCALBOOT"); + echo "LOCALBOOT -1\n"; + texthelp("Gets you out of here by booting from next device in BIOS boot + order."); + } + + function texthelp ( $texthelp ){ + echo "TEXT HELP\n"; + echo $texthelp."\n"; + echo "ENDTEXT\n"; + } + + function retry () { + echo "label failed\n"; + echo " menu label Authentication Failed\n"; + echo " menu disable\n"; + uriboot ( "Try again", "ipxe.php", "" ); + } + + function authenticated () { + global $username; + global $password; + + switch ( "$username:$password" ) { + case "test:test": + case "guest:guest": + return 1; + default: + return 0; + } + } + + ?> +TIMEOUT 100 +PROMPT 0 +DEFAULT vesamenu.c32 + +MENU BACKGROUND http://pbs2.mp.openslx.org/media/img/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;37;40 #ffff8b00 #ff8093a1 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 #ffff8b00 #ff8093a1 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 + +<? + if(!isset($this->error)) + title ( $this->title ); + else + title($this->error); +// +// if ( ! authenticated() ) { +// retry(); +// } else { +// +// if ( $username == "test" ) { +// +// localboot(); +// } + +$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/resource/getkernel/alpha/$this->alphaID/file/kernel", "initrd=http://$this->host/resource/getinitramfs/alpha/$this->alphaID/file/initramfs $kcl alpha=$this->alphaID file=http://$this->host/c/$this->alphaID/default.tgz ".$bme->getKclappend()); + }else{ + uriboot ( $bme->getTitle(), + "http://$this->host/resource/getkernel/alpha/$this->alphaID/file/kernel", "initrd=http://$this->host/resource/getinitramfs/alpha/$this->alphaID/file/initramfs alpha=$this->alphaID file=http://$this->host/c/$this->alphaID/default.tgz ".$bme->getKclappend()); + } + } +} + +localboot(); +// } + +// LABEL SLXSTDBOOT +// MENU LABEL +// KERNEL kernel +// APPEND initrd=init vga=0x317 +// TEXT HELP +// Use this (default) entry if you have configured your client. +// You have chance to edit the kernel commandline by hitting the +// TAB key (e.g. for adding debug=3 to it for bug hunting) ... +// ENDTEXT +//LABEL DEBUGBOOT +// MENU LABEL OpenSLX PreBoot - Debug Mode +// KERNEL kernel +// APPEND initrd=init vga=0x317 debug=3 +// TEXT HELP +// Use this to start the preboot environment with debug shells. +// ENDTEXT + + + ?>
\ No newline at end of file |
