wok-stable rev 12281

installer.cgi: fix broken user input checkings
author Dominique Corbex <domcox@slitaz.org>
date Mon May 07 07:49:37 2012 +0200 (2012-05-07)
parents b7f511a46679
children f329abe6b8ff
files tazpanel/receipt tazpanel/stuff/installer.patch
line diff
     1.1 --- a/tazpanel/receipt	Sun May 06 11:56:02 2012 +0200
     1.2 +++ b/tazpanel/receipt	Mon May 07 07:49:37 2012 +0200
     1.3 @@ -16,8 +16,11 @@
     1.4  # Rules to configure and make the package.
     1.5  compile_rules()
     1.6  {
     1.7 -  cd $src && make && 
     1.8 -  make DESTDIR=$DESTDIR install
     1.9 +	cd $src # && make && 
    1.10 +		# installer.cgi user validation fix
    1.11 +		patch -p0 < $stuff/installer.patch || return 1
    1.12 +		make &&
    1.13 +	make DESTDIR=$DESTDIR install
    1.14  }
    1.15  
    1.16  # Rules to gen a SliTaz package suitable for Tazpkg.
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tazpanel/stuff/installer.patch	Mon May 07 07:49:37 2012 +0200
     2.3 @@ -0,0 +1,56 @@
     2.4 +--- installer.cgi
     2.5 ++++ installer.cgi.new
     2.6 +@@ -433,8 +433,8 @@
     2.7 + 	<h5 id="hostname">$(gettext 'Hostname')</h5>
     2.8 + 
     2.9 + 	$(gettext 'Set Hostname to:')
    2.10 +-	<input type="text" id="hostname" name="TGT_HOSTNAME" value="$TGT_HOSTNAME" placeholder="$(gettext 'Name of your system')" onkeyup="checkLogin('hostname','msgHostname'); return false;" />
    2.11 +-	<span id="msgHostname"></span>
    2.12 ++	<input type="text" id="hst" name="TGT_HOSTNAME" value="$TGT_HOSTNAME" placeholder="$(gettext 'Name of your system')" onkeyup="checkLogin('hst','msgHst'); return false;" />
    2.13 ++	<span id="msgHst"></span>
    2.14 + </div>
    2.15 + EOT
    2.16 + }
    2.17 +@@ -442,7 +442,7 @@
    2.18 + select_root()
    2.19 + {
    2.20 + cat << EOT
    2.21 +-<div class="box2">
    2.22 ++<div>
    2.23 + 	<h5 id="root">$(gettext 'Root')</h5>
    2.24 + 
    2.25 + 	$(gettext 'Root passwd:')
    2.26 +@@ -459,12 +459,12 @@
    2.27 + select_user()
    2.28 + {
    2.29 + cat << EOT
    2.30 +-<div class="box2">
    2.31 ++<div>
    2.32 + 	<h5 id="user">$(gettext 'User')</h5>
    2.33 + 
    2.34 + 	$(gettext 'User login:')
    2.35 +-	<input type="text" id="user" name="TGT_USER" value="$TGT_USER" placeholder="$(gettext 'Name of the first user')" onkeyup="checkLogin('user','msgUser'); return false;" />
    2.36 +-	<span id="msgUser"></span>
    2.37 ++	<input type="text" id="usr" name="TGT_USER" value="$TGT_USER" placeholder="$(gettext 'Name of the first user')" onkeyup="checkLogin('usr','msgUsr'); return false;" />
    2.38 ++	<span id="msgUsr"></span>
    2.39 + 	<br /><br />
    2.40 + 
    2.41 + 	$(gettext 'User passwd:')
    2.42 +@@ -618,7 +618,7 @@
    2.43 + 	function Validate(page) {
    2.44 + 		if (page == "install") {
    2.45 + 			// hostname
    2.46 +-			if (false == checkLogin('hostname','msgHostname')) {
    2.47 ++			if (false == checkLogin('hst','msgHst')) {
    2.48 + 				alert("$(gettext 'Hostname error')");
    2.49 + 				return false;
    2.50 + 			// root pwd
    2.51 +@@ -626,7 +626,7 @@
    2.52 + 				alert("$(gettext 'Root password error')");
    2.53 + 				return false;
    2.54 + 			// user
    2.55 +-			} else if (false == checkLogin('user','msgUser')) {
    2.56 ++			} else if (false == checkLogin('usr','msgUsr')) {
    2.57 + 				alert("$(gettext 'User login error')");
    2.58 + 				return false;
    2.59 + 			// user pwd