tazpanel rev 349 1.6.2
move tazint to its own repo
author | Dominique Corbex <domcox@slitaz.org> |
---|---|
date | Wed Feb 20 09:44:56 2013 +0100 (2013-02-20) |
parents | 972b3169b3e4 |
children | 650eb94b94fb |
files | AUTHORS Makefile installer.cgi lib/user.js styles/default/header.html styles/default/style.css |
line diff
1.1 --- a/AUTHORS Sun Feb 17 12:53:34 2013 +0100 1.2 +++ b/AUTHORS Wed Feb 20 09:44:56 2013 +0100 1.3 @@ -1,6 +1,5 @@ 1.4 Christophe Lincoln <pankso@slitaz.org> 1.5 Pascal Bellard <pascal.bellard@slitaz.org> 1.6 Paul Issot <paul@slitaz.org> 1.7 -Dominique Corbex <domcox@slitaz.org> 1.8 Christian Mesh <meshca@clarkson.edu> 1.9 Aleksej Bobylev <al.bobylev@gmail.com>
2.1 --- a/Makefile Sun Feb 17 12:53:34 2013 +0100 2.2 +++ b/Makefile Wed Feb 20 09:44:56 2013 +0100 2.3 @@ -17,8 +17,8 @@ 2.4 --package-name="TazPanel" \ 2.5 --package-version="$(VERSION)" \ 2.6 ./tazpanel ./index.cgi ./pkgs.cgi ./live.cgi ./network.cgi ./boot.cgi \ 2.7 - ./hardware.cgi ./settings.cgi ./lib/libtazpanel ./installer.cgi \ 2.8 - ./help.cgi ./styles/default/header.html ./styles/default/footer.html 2.9 + ./hardware.cgi ./settings.cgi ./lib/libtazpanel ./help.cgi \ 2.10 + ./styles/default/header.html ./styles/default/footer.html 2.11 2.12 msgmerge: 2.13 @for l in $(LINGUAS); do \
3.1 --- a/installer.cgi Sun Feb 17 12:53:34 2013 +0100 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,764 +0,0 @@ 3.4 -#!/bin/sh 3.5 -# 3.6 -# Main CGI interface for Tazinst, the SliTaz installer. 3.7 -# 3.8 -# Copyright (C) 2012 SliTaz GNU/Linux - BSD License 3.9 -# 3.10 -# Authors : Dominique Corbex <domcox@slitaz.org> 3.11 -# 3.12 - 3.13 -VERSION=0.30 3.14 - 3.15 -# Common functions from libtazpanel 3.16 -. lib/libtazpanel 3.17 -header 3.18 -get_config 3.19 - 3.20 -# Include gettext helper script. 3.21 -. /usr/bin/gettext.sh 3.22 - 3.23 -# Export package name for gettext. 3.24 -#TEXTDOMAIN='installer' 3.25 -#export TEXTDOMAIN 3.26 - 3.27 -TITLE=$(gettext 'TazPanel - Installer') 3.28 - 3.29 -# Tazinst required version 3.30 -TAZINST_REQUIRED_VERSION="3.3" 3.31 - 3.32 -# Tazinst setup file 3.33 -INSTFILE=/var/lib/tazinst.conf 3.34 - 3.35 - 3.36 -write_setup() 3.37 -{ 3.38 - if [ -e "$INSTFILE" ]; then 3.39 - # Install type 3.40 - INST_TYPE=$(GET INST_TYPE) 3.41 - # Source File 3.42 - case "$INST_TYPE" in 3.43 - usb) 3.44 - SRC_FILE=$(GET SRC_USB) ;; 3.45 - iso) 3.46 - SRC_FILE=$(GET SRC_ISO) ;; 3.47 - web) 3.48 - SRC_FILE=$(GET SRC_WEB) ;; 3.49 - esac 3.50 - SRC_FILE=$(echo "$SRC_FILE" | sed 's/\//\\\//'g) 3.51 - [ -n $(GET URL) ] && SRC_WEB=$(GET URL) 3.52 - # Main Partition 3.53 - TGT_PARTITION=$(echo "$(GET TGT_PARTITION)" | sed 's/\//\\\//'g) 3.54 - [ -n "$(GET MAIN_FMT)" ] && TGT_FS=$(GET MAIN_FS) || TGT_FS="" 3.55 - # Home Partition 3.56 - if [ -n "$(GET HOME_SELECT)" ] ; then 3.57 - TGT_HOME=$(echo "$(GET TGT_HOME)" | sed 's/\//\\\//'g) 3.58 - [ -n "$(GET HOME_FMT)" ] && TGT_HOME_FS=$(GET HOME_FS) || TGT_HOME_FS="" 3.59 - else 3.60 - TGT_HOME="" 3.61 - TGT_HOME_FS="" 3.62 - fi 3.63 - # Hostname 3.64 - TGT_HOSTNAME=$(GET TGT_HOSTNAME) 3.65 - # Root pwd 3.66 - TGT_ROOT_PWD=$(GET TGT_ROOT_PWD) 3.67 - # User Login 3.68 - TGT_USER=$(GET TGT_USER) 3.69 - # User Pwd 3.70 - TGT_USER_PWD=$(GET TGT_USER_PWD) 3.71 - # Grub 3.72 - TGT_GRUB=$(GET TGT_GRUB) 3.73 - [ "$TGT_GRUB" == "yes" ] || TGT_GRUB=no 3.74 - # Win Dual-Boot 3.75 - TGT_WINBOOT=$(GET TGT_WINBOOT) 3.76 - 3.77 - # Save changes to INSTFILE 3.78 - sed -i s/"^INST_TYPE=.*"/"INST_TYPE=\"$INST_TYPE\"/" $INSTFILE 3.79 - sed -i s/"^SRC_FILE=.*"/"SRC_FILE=\"$SRC_FILE\"/" $INSTFILE 3.80 - sed -i s/"^TGT_PARTITION=.*"/"TGT_PARTITION=\"$TGT_PARTITION\"/" $INSTFILE 3.81 - sed -i s/"^TGT_FS=.*"/"TGT_FS=\"$TGT_FS\"/" $INSTFILE 3.82 - sed -i s/"^TGT_HOME=.*"/"TGT_HOME=\"$TGT_HOME\"/" $INSTFILE 3.83 - sed -i s/"^TGT_HOME_FS=.*"/"TGT_HOME_FS=\"$TGT_HOME_FS\"/" $INSTFILE 3.84 - sed -i s/"^TGT_HOSTNAME=.*"/"TGT_HOSTNAME=\"$TGT_HOSTNAME\"/" $INSTFILE 3.85 - sed -i s/"^TGT_ROOT_PWD=.*"/"TGT_ROOT_PWD=\"$TGT_ROOT_PWD\"/" $INSTFILE 3.86 - sed -i s/"^TGT_USER=.*"/"TGT_USER=\"$TGT_USER\"/" $INSTFILE 3.87 - sed -i s/"^TGT_USER_PWD=.*"/"TGT_USER_PWD=\"$TGT_USER_PWD\"/" $INSTFILE 3.88 - sed -i s/"^TGT_GRUB=.*"/"TGT_GRUB=\"$TGT_GRUB\"/" $INSTFILE 3.89 - sed -i s/"^TGT_WINBOOT=.*"/"TGT_WINBOOT=\"$TGT_WINBOOT\"/" $INSTFILE 3.90 - fi 3.91 -} 3.92 - 3.93 -read_setup() 3.94 -{ 3.95 - # various checks on setup file 3.96 - if [ -e "$INSTFILE" ]; then 3.97 - # validity check + reformat output 3.98 - tazinst check $INSTFILE | awk ' 3.99 -BEGIN{ 3.100 - fmt1="<span class=\"msg-nok\">" 3.101 - fmt2="<br /></span>" 3.102 - OFS="" 3.103 - } 3.104 -{ 3.105 - # make html compliant 3.106 - str=$0 3.107 - gsub(/\[1m/,"",str) 3.108 - gsub(/\[0m/,"",str) 3.109 - gsub(/\s/,"\\ ",str) 3.110 - gsub(/</,"\\<",str) 3.111 - gsub(/>/,"\\>",str) 3.112 - a[i++]=str 3.113 -} END { 3.114 - {print fmt1,a[i-1],fmt2} 3.115 - {for (j=0; j<i-1;) print fmt1,substr(a[j++],3),fmt2} 3.116 -}' 3.117 - else 3.118 - # no setup file found: creating 3.119 - eval_gettext 'Creating setup file $INSTFILE.' 3.120 - tazinst new $INSTFILE 3.121 - if [ ! -e "$INSTFILE" ]; then 3.122 - cat <<EOT 3.123 -<span class="msg-nok">$(gettext 'Setup File Error')<br /> 3.124 -$(eval_gettext "The setup file <strong>\$INSTFILE</strong> doesn't \ 3.125 -exist.")</span><br /> 3.126 -EOT 3.127 - else 3.128 - if [ ! -r $INSTFILE ]; then 3.129 - cat <<EOT 3.130 -<span class="msg-nok">$(gettext 'Setup File Error')<br /> 3.131 -$(eval_gettext "The setup file <strong>$INSTFILE</strong> is not readable. \ 3.132 -Check permissions and ownership.")</span><br /> 3.133 -EOT 3.134 - fi 3.135 - fi 3.136 - fi 3.137 - # read setup file 3.138 - . $INSTFILE 3.139 -} 3.140 - 3.141 -select_action() 3.142 -{ 3.143 - cat <<EOT 3.144 -<div id="wrapper"> 3.145 - <h2>$(gettext 'SliTaz Installer')</h2> 3.146 - 3.147 -<p>$(gettext "The SliTaz Installer installs or upgrades SliTaz to a hard disk \ 3.148 -drive from a device like a Live-CD or LiveUSB key, from a SliTaz ISO file, or \ 3.149 -from the web by downloading an ISO file.")</p> 3.150 -</div> 3.151 -EOT 3.152 -} 3.153 - 3.154 -select_install() 3.155 -{ 3.156 - cat <<EOT 3.157 -<section> 3.158 - <h4>$(gettext 'Install')</h4> 3.159 - 3.160 -<p>$(gettext "Install SliTaz on a partition of your hard disk drive. If you \ 3.161 -decide to format your partition, all data will be lost. If you do not format, \ 3.162 -all data except for any existing /home directory will be removed (note the home \ 3.163 -directory contents will be kept as is).")</p> 3.164 - 3.165 -<p>$(gettext "Before installation, you may need to create or resize partitions \ 3.166 -on your hard disk drive in order to make space for SliTaz GNU/Linux. You can \ 3.167 -graphically manage your partitions with Gparted.")</p> 3.168 - 3.169 -<a class="button" href="$SCRIPT_NAME?page=partitioning">$(gettext "Install \ 3.170 -SliTaz") <img src="$IMAGES/go-next.png" /></a> 3.171 -</section> 3.172 -EOT 3.173 -} 3.174 - 3.175 -select_upgrade() 3.176 -{ 3.177 - cat <<EOT 3.178 -<section> 3.179 - <h4>$(gettext 'Upgrade')</h4> 3.180 - 3.181 -<p>$(gettext "Upgrade an already installed SliTaz system on your hard disk \ 3.182 -drive. Your /home /etc /var/www directories will be kept, all other \ 3.183 -directories will be removed. Any additional packages added to your old Slitaz \ 3.184 -system will be updated as long you have an active internet connection.")</p> 3.185 - 3.186 -<a class="button" href="$SCRIPT_NAME?page=upgrade">$(gettext "Upgrade \ 3.187 -SliTaz") <img src="$IMAGES/go-next.png" /></a> 3.188 -</section> 3.189 -EOT 3.190 -} 3.191 - 3.192 -select_gparted() 3.193 -{ 3.194 - cat <<EOT 3.195 -<h4>$(gettext 'Partitioning')</h4> 3.196 -<div class="box"> 3.197 - 3.198 -<p>$(gettext "On most used systems, the hard drive is already dedicated to \ 3.199 -partitions for Windows<sup>™</sup>, or Linux, or another operating \ 3.200 -system. You'll need to resize these partitions in order to make space for \ 3.201 -SliTaz GNU/Linux. SliTaz will co-exist with other operating systems already \ 3.202 -installed on your hard drive.")</p> 3.203 - 3.204 -<p>$(gettext "The amount of space needed depends on how much software you plan \ 3.205 -to install and how much space you require for users. It's conceivable that you \ 3.206 -could run a minimal SliTaz system in 300 megs or less, but 2 gigs is indeed \ 3.207 -more comfy.")</p> 3.208 - 3.209 -<p>$(gettext "A separate home partition, and a partition that will be used as \ 3.210 -Linux swap space may be created if needed. Slitaz detects and uses swap \ 3.211 -partitions automatically.")</p> 3.212 - 3.213 -</div> 3.214 - 3.215 -<div class="box"> 3.216 - 3.217 -<p>$(gettext "You can graphically manage your partitions with Gparted. GParted \ 3.218 -is a partition editor for graphically managing your disk partitions. Gparted \ 3.219 -allows you to create, destroy, resize and copy partitions without data loss.")</p> 3.220 - 3.221 -<p>$(gettext "Gparted supports ext2, ext3, ext4, linux swap, ntfs and fat32 \ 3.222 -filesystems right out of the box. Support for xjs, jfs, hfs and other \ 3.223 -filesystems is available as well but you first need to add drivers for these \ 3.224 -filesystems by installing the related packages xfsprogs, jfsutils, linux-hfs \ 3.225 -and so on.")</p> 3.226 -</div> 3.227 - 3.228 -<a class="button" href="$SCRIPT_NAME?page=gparted">$(gettext 'Execute Gparted')</a> 3.229 - 3.230 -<h5>$(gettext 'Continue installation')</h5> 3.231 - 3.232 -<p>$(gettext "Once you've made room for SliTaz on your drive, you should be \ 3.233 -able to continue installation.") 3.234 - 3.235 -<hr /> 3.236 -<a class="button" value="$1" href="$SCRIPT_NAME?page=home" > 3.237 - <img src="$IMAGES/go-first.png"/> $(gettext 'Back to Installer Start Page')</a> 3.238 -<a class="button" value="$2" href="$SCRIPT_NAME?page=install"> 3.239 - $(gettext 'Continue Installation') <img src="$IMAGES/go-next.png" /></a> 3.240 -EOT 3.241 -} 3.242 - 3.243 -display_action() 3.244 -{ 3.245 - case $1 in 3.246 - install) 3.247 - cat << EOT 3.248 -<div id="wrapper"> 3.249 -<h3>$(gettext 'Install SliTaz')</h3> 3.250 - 3.251 -<p>$(gettext "You're going to install SliTaz on a partition of your hard disk \ 3.252 -drive. If you decide to format your HDD, all data will be lost. If you do not \ 3.253 -format, all data except for any existing /home directory will be removed (note the \ 3.254 -home directory contents will be kept as is)."<p> 3.255 -</div> 3.256 -<input type="hidden" name="INST_ACTION" value="$1"> 3.257 -EOT 3.258 - ;; 3.259 - upgrade) 3.260 - cat << EOT 3.261 -<div id="wrapper"> 3.262 -<h2>$(gettext 'Upgrade SliTaz')</h2> 3.263 - 3.264 -<p>$(gettext "You're going to upgrade an already installed SliTaz system on \ 3.265 -your hard disk drive. Your /home /etc /var/www directories will be kept, all \ 3.266 -other directories will be removed. Any additional packages added to your old \ 3.267 -Slitaz system will be updated as long you have an active internet connection.")<p> 3.268 -</div> 3.269 -<input type="hidden" name="INST_ACTION" value="$1"> 3.270 -EOT 3.271 - ;; 3.272 - esac 3.273 -} 3.274 - 3.275 -select_source() 3.276 -{ 3.277 - cat <<EOT 3.278 -<h4 id="source">$(gettext 'Slitaz source media')</h4> 3.279 - 3.280 -<div class="box"> 3.281 -<input type="radio" name="INST_TYPE" value="cdrom" $([ "$INST_TYPE" == "cdrom" ] && echo "checked") id="cdrom" /> 3.282 -<label for="cdrom">$(gettext 'LiveCD')</label> 3.283 -<br /> 3.284 -<input type="radio" name="INST_TYPE" value="usb" $([ "$INST_TYPE" == "usb" ] && echo "checked") id="usb" /> 3.285 -<label for="usb">$(gettext 'LiveUSB:') 3.286 -<select name="SRC_USB"> 3.287 -EOT 3.288 - # List disks if plugged USB device 3.289 - usb=0 3.290 - if [ -d /proc/scsi/usb-storage ]; then 3.291 - for DEV in /sys/block/sd* ; do 3.292 - if readlink $DEV | grep -q usb; then 3.293 - DEV=$(basename $DEV) 3.294 - if [ -d /sys/block/${DEV}/${DEV}1 ]; then 3.295 - for i in $(fdisk -l /dev/$DEV | awk '/^\/dev/ {printf "%s ", $1}') ; do 3.296 - echo "<option value='$i' $([ "$i" == "$SRC_FILE" ] && echo 'selected') >$i</option>" 3.297 - usb=$usb+1 3.298 - done 3.299 - fi 3.300 - fi 3.301 - done 3.302 - fi 3.303 - if [ $usb -lt 1 ]; then 3.304 - echo "<option value="">$(gettext 'Not found')</option>" 3.305 - fi 3.306 - cat << EOT 3.307 -</select> 3.308 -</label> 3.309 -<br /> 3.310 -<input type="radio" name="INST_TYPE" value="iso" $([ "$INST_TYPE" == "iso" ] && echo "checked") id="iso" /> 3.311 -<label for="iso">$(gettext 'ISO file:')</label> 3.312 -<input type="url" size="50" name="SRC_ISO" $([ "$INST_TYPE" == "iso" ] && echo -e "value=\"$SRC_FILE\"") placeholder="$(gettext 'Full path to the ISO image file')" /> 3.313 -<br /> 3.314 -<input type="radio" name="INST_TYPE" value="web" $([ "$INST_TYPE" == "web" ] && echo "checked") id="web" /> 3.315 -<label for="web">$(gettext 'Web:') 3.316 - <a class="button" onclick="document.forms['ConfigForm'].url.value = '$(tazinst showurl stable)'; return true;">$(gettext 'Stable')</a> 3.317 - <a class="button" onclick="document.forms['ConfigForm'].url.value = '$(tazinst showurl cooking)'; return true;">$(gettext 'Cooking')</a> 3.318 - 3.319 - $(gettext 'URL:') 3.320 - <input id="url" type="url" size="55" name="SRC_WEB" $([ "$INST_TYPE" == "web" ] && echo -e "value=\"$SRC_FILE\"") placeholder="$(gettext 'Full url to an ISO image file')" /> 3.321 -</label> 3.322 -</div> 3.323 -EOT 3.324 -} 3.325 - 3.326 -select_hdd() 3.327 -{ 3.328 -cat <<EOT 3.329 - <h4 id="hdd">$(gettext 'Hard Disk Drive')</h4> 3.330 -EOT 3.331 -} 3.332 - 3.333 -select_partition() 3.334 -{ 3.335 - cat <<EOT 3.336 -<div class="box"> 3.337 -<a name="partition"></a> 3.338 -$(gettext 'Install Slitaz to partition:') 3.339 -<select name="TGT_PARTITION"> 3.340 -EOT 3.341 - # List partitions 3.342 - if fdisk -l | grep -q ^/dev/ ; then 3.343 - echo "<option value="">$(gettext 'None')</option>" 3.344 - for i in $(fdisk -l | awk '/^\/dev/ {printf "%s " $1}'); do 3.345 - echo "<option value='$i' $([ "$i" == "$TGT_PARTITION" ] && echo 'selected')>$i</option>" 3.346 - done 3.347 - else 3.348 - echo "<option value="">$(gettext 'Not found')</option>" 3.349 - fi 3.350 - cat << EOT 3.351 -</select> 3.352 -<br /> 3.353 -<input type="checkbox" name="MAIN_FMT" value="yes" $([ -n "$TGT_FS" ] && echo "checked") id="mainfs" /> 3.354 -<label for="mainfs">$(gettext 'Format partition as:')</label> 3.355 -<select name="MAIN_FS"> 3.356 -EOT 3.357 - scan_mkfs 3.358 - for i in $FS 3.359 - do 3.360 - echo "<option value='$i' $([ "$i" == "$TGT_FS" ] && echo 'selected')>$i</option>" 3.361 - done 3.362 - cat <<EOT 3.363 -</select> 3.364 -</div> 3.365 -EOT 3.366 -} 3.367 - 3.368 -select_old_slitaz() 3.369 -{ 3.370 - cat <<EOT 3.371 -<div class="box"> 3.372 -<a name="partition"></a> 3.373 -$(gettext 'Existing SliTaz partition to upgrade:') 3.374 -<select name="TGT_PARTITION"> 3.375 -EOT 3.376 - # List partitions 3.377 - if fdisk -l | grep -q ^/dev/ ; then 3.378 - echo "<option value="">$(gettext 'None')</option>" 3.379 - for i in $(blkid | cut -d ":" -f 1); do 3.380 - echo "<option value='$i' $([ "$i" == "$TGT_PARTITION" ] && echo 'selected')>$i</option>" 3.381 - done 3.382 - else 3.383 - echo "<option value="">$(gettext 'Not found')</option>" 3.384 - fi 3.385 - cat <<EOT 3.386 -</select> 3.387 -</div> 3.388 -EOT 3.389 -} 3.390 - 3.391 -select_options() 3.392 -{ 3.393 - cat <<EOT 3.394 -<h4 id="options">$(gettext 'Options')</h4> 3.395 -EOT 3.396 -} 3.397 - 3.398 -select_home() 3.399 -{ 3.400 - cat <<EOT 3.401 -<div> 3.402 -<h5 id="home">$(gettext 'home partition')</h5> 3.403 - 3.404 -<input type="checkbox" name="HOME_SELECT" value="yes" $([ -n "$TGT_HOME" ] && echo "checked") id="homepart" /> 3.405 -<label for="homepart">$(gettext 'Use a separate partition for /home:')</label> 3.406 -<select name="TGT_HOME"> 3.407 -EOT 3.408 - # List disk if plugged USB device 3.409 - if fdisk -l | grep -q ^/dev/ ; then 3.410 - echo "<option value="">$(gettext 'None')</option>" 3.411 - for i in $(fdisk -l | awk '/^\/dev/ {printf "%s " $1}'); do 3.412 - echo "<option value='$i' $([ "$i" == "$TGT_HOME" ] && echo 'selected')>$i</option>" 3.413 - done 3.414 - else 3.415 - echo "<option value="">$(gettext 'Not found')</option>" 3.416 - fi 3.417 -cat <<EOT 3.418 -</select> 3.419 - 3.420 -<input type="checkbox" name="HOME_FMT" value="yes" $([ -n "$TGT_HOME_FS" ] && echo "checked") id="homefs" /> 3.421 -<label for="homefs">$(gettext 'Format partition as:')</label> 3.422 -<select name="HOME_FS">" 3.423 -EOT 3.424 - for i in $FS 3.425 - do 3.426 - echo "<option value='$i' $([ "$i" == "$TGT_HOME_FS" ] && echo 'selected')>$i</option>" 3.427 - done 3.428 - cat <<EOT 3.429 -</select> 3.430 -</div> 3.431 -EOT 3.432 -} 3.433 - 3.434 -select_hostname() 3.435 -{ 3.436 -cat << EOT 3.437 -<div> 3.438 - <h5 id="hostname">$(gettext 'Hostname')</h5> 3.439 - 3.440 - $(gettext 'Set Hostname to:') 3.441 - <input type="text" id="hst" name="TGT_HOSTNAME" value="$TGT_HOSTNAME" placeholder="$(gettext 'Name of your system')" onkeyup="checkLogin('hst','msgHst'); return false;" /> 3.442 - <span id="msgHst"></span> 3.443 -</div> 3.444 -EOT 3.445 -} 3.446 - 3.447 -select_root() 3.448 -{ 3.449 -cat << EOT 3.450 -<div> 3.451 - <h5 id="root">$(gettext 'Root')</h5> 3.452 - 3.453 - $(gettext 'Root passwd:') 3.454 - <input type="password" id="rootPwd1" name="TGT_ROOT_PWD" value="$TGT_ROOT_PWD" placeholder="$(gettext 'Password of root')" onkeyup="checkPwd('rootPwd1','rootPwd2','msgRootPwd'); return false;" /> 3.455 - 3.456 - $(gettext 'Confirm password:') 3.457 - <input type="password" id="rootPwd2" value="$TGT_ROOT_PWD" placeholder="$(gettext 'Password of root')" onkeyup="checkPwd('rootPwd1','rootPwd2','msgRootPwd'); return false;" /> 3.458 - 3.459 - <span id="msgRootPwd"></span> 3.460 -</div> 3.461 -EOT 3.462 -} 3.463 - 3.464 -select_user() 3.465 -{ 3.466 -cat << EOT 3.467 -<div> 3.468 - <h5 id="user">$(gettext 'User')</h5> 3.469 - 3.470 - $(gettext 'User login:') 3.471 - <input type="text" id="usr" name="TGT_USER" value="$TGT_USER" placeholder="$(gettext 'Name of the first user')" onkeyup="checkLogin('usr','msgUsr'); return false;" /> 3.472 - <span id="msgUsr"></span> 3.473 - <br /><br /> 3.474 - 3.475 - $(gettext 'User passwd:') 3.476 - <input type="password" id="userPwd1" name="TGT_USER_PWD" value="$TGT_USER_PWD" placeholder="$(gettext 'Password of the first user')" onkeyup="checkPwd('userPwd1','userPwd2','msgUserPwd'); return false;" /> 3.477 - 3.478 - $(gettext 'Confirm password:') 3.479 - <input class="confirm" type="password" id="userPwd2" value="$TGT_USER_PWD" placeholder="$(gettext 'Password of the first user')" onkeyup="checkPwd('userPwd1','userPwd2','msgUserPwd'); return false;" /> 3.480 - <span id="msgUserPwd"></span> 3.481 -</div> 3.482 -EOT 3.483 -} 3.484 - 3.485 -select_grub() 3.486 -{ 3.487 -cat << EOT 3.488 -<div> 3.489 - <h5 id="grub">$(gettext 'Grub')</h5> 3.490 - 3.491 - <input type="checkbox" name="TGT_GRUB" value="yes" $([ "$TGT_GRUB" == "yes" ] && echo "checked") id="grub" /> 3.492 - <label for="grub">$(gettext "Install Grub bootloader. Usually you should \ 3.493 -answer yes, unless you want to install grub by hand yourself.")<br /></label> 3.494 - <input type="checkbox" name="TGT_WINBOOT" value="auto" $([ -n "$TGT_WINBOOT" ] && echo "checked") id="dualboot" /> 3.495 - <label for="dualboot">$(gettext 'Enable Windows Dual-Boot.')</label> 3.496 -</div> 3.497 -EOT 3.498 -} 3.499 - 3.500 -moveto_page() 3.501 -{ 3.502 - case $1 in 3.503 - partitioning) 3.504 - title1="<img src=\"$IMAGES/go-previous.png\" /> $(gettext 'Back to partitioning')" ;; 3.505 - *) 3.506 - page=home 3.507 - title1="<img src=\"$IMAGES/go-first.png\" /> $(gettext 'Back to Installer Start Page')" ;; 3.508 - esac 3.509 - case $2 in 3.510 - write|run) 3.511 - title2="$(gettext 'Proceed to SliTaz installation') <img src=\"$IMAGES/go-next.png\" />" ;; 3.512 - reboot) 3.513 - title2=$(gettext 'Installation complete. You can now restart (reboot)') ;; 3.514 - failed) 3.515 - title2=$(gettext 'Installation failed. See log') ;; 3.516 - *) 3.517 - page=home 3.518 - title2="<img src=\"$IMAGES/go-first.png\" /> $(gettext 'Back to Installer Start Page')" ;; 3.519 - esac 3.520 - cat <<EOT 3.521 -<hr /> 3.522 -<a class="button" value="$1" href="$SCRIPT_NAME?page=$1" >$title1</a> 3.523 -<a class="button" value="$2" href="$SCRIPT_NAME?page=$2" >$title2</a> 3.524 -EOT 3.525 -} 3.526 - 3.527 -page_redirection() 3.528 -{ 3.529 - cat << EOT 3.530 -<!DOCTYPE html> 3.531 -<html> 3.532 -<head> 3.533 -<meta charset="utf-8"> 3.534 -<title>$(gettext "A web page that points a browser to a different page after \ 3.535 -2 seconds")</title> 3.536 -<meta http-equiv="refresh" content="0; URL=$SCRIPT_NAME?page=$1"> 3.537 -<meta name="keywords" content="automatic redirection"> 3.538 -</head> 3.539 -<body> 3.540 -<p>$(gettext "If your browser doesn't automatically redirect within a few \ 3.541 -seconds, you may want to go there manually")</p> 3.542 -<p><a href="$SCRIPT_NAME?page=$1">$1</a></p> 3.543 -</body> 3.544 -</html> 3.545 -EOT 3.546 -} 3.547 - 3.548 -check_ressources() 3.549 -{ 3.550 - local code 3.551 - code=0 3.552 - # Check tazinst 3.553 - if ! [ -x /usr/sbin/tazinst ] ; then 3.554 - cat <<EOT 3.555 -<h3>$(gettext 'Tazinst Error')</h3> 3.556 -<p>$(gettext "<strong>tazinst</strong>, the lightweight SliTaz HDD installer \ 3.557 -is missing. Any installation cannot be done without tazinst.")</p> 3.558 - 3.559 -<p>$(gettext "Check tazinst' permissions, or reinstall the slitaz-tools \ 3.560 -package:")</p> 3.561 -<code># tazpkg get-install slitaz-tools --forced</code> 3.562 -EOT 3.563 - code=1 3.564 - else 3.565 - # Check tazinst required version 3.566 - v=$(tazinst version | tr -d '[:alpha:]') 3.567 - r=$TAZINST_REQUIRED_VERSION 3.568 - if ! (echo "$v" | awk -v r=$r '{v=$v+0}{ if (v < r) exit 1}') ; then 3.569 - cat <<EOT 3.570 -<h3>$(gettext 'Tazinst Error')</h3> 3.571 - 3.572 -<p>$(eval_gettext "<strong>tazinst</strong> ($v) is not at the required \ 3.573 -version ($r), use tazinst in a xterm or reinstall the slitaz-tools package:")</p> 3.574 -<code># tazpkg get-install slitaz-tools --forced</code> 3.575 -EOT 3.576 - code=1 3.577 - fi 3.578 - fi 3.579 - return $code 3.580 -} 3.581 - 3.582 -run_tazinst() 3.583 -{ 3.584 - cat << EOT 3.585 -<h4>$(gettext 'Proceeding: ()')</h4> 3.586 -<p>$(gettext 'Please wait until processing is complete')</p> 3.587 -EOT 3.588 - table_start 3.589 - tazinst $(GET INST_ACTION) $INSTFILE | \ 3.590 - awk '{print "<tr><td><tt>" $0 "</tt></td></tr>"}' 3.591 - table_end 3.592 - echo "<p>$(gettext 'Completed.')</p>" 3.593 - return $(grep -c "cancelled on error" $INSTFILE) 3.594 -} 3.595 - 3.596 -tazinst_log() 3.597 -{ 3.598 - echo "<pre>$(tazinst log)</pre>" 3.599 -} 3.600 - 3.601 -scan_mkfs() 3.602 -{ 3.603 - for path in /bin /sbin /usr/bin /usr/sbin 3.604 - do 3.605 - [ -e $path/mkfs.btrfs ] && FS=btrfs 3.606 - [ -e $path/mkfs.cramfs ] && FS="$FS cramfs" 3.607 - [ -e $path/mkfs.ext2 ] && FS="$FS ext2" 3.608 - [ -e $path/mkfs.ext3 ] && FS="$FS ext3" 3.609 - [ -e $path/mkfs.ext4 ] && FS="$FS ext4" 3.610 - [ -e $path/mkfs.jfs ] && FS="$FS jfs" 3.611 - [ -e $path/mkfs.minix ] && FS="$FS minix" 3.612 - [ -e $path/mkfs.reiserfs ] && FS="$FS reiserfs" 3.613 - [ -e $path/mkfs.xfs ] && FS="$FS xfs" 3.614 - done 3.615 -} 3.616 - 3.617 -form_start() 3.618 -{ 3.619 - cat <<EOT 3.620 -<script src="lib/user.js"></script> 3.621 -<script type="text/javascript"> 3.622 - function Validate(page) { 3.623 - if (page == "install") { 3.624 - // hostname 3.625 - if (false == checkLogin('hst','msgHst')) { 3.626 - alert("$(gettext 'Hostname error')"); 3.627 - return false; 3.628 - // root pwd 3.629 - } else if (false == checkPwd('rootPwd1','rootPwd2','msgRootPwd')) { 3.630 - alert("$(gettext 'Root password error')"); 3.631 - return false; 3.632 - // user 3.633 - } else if (false == checkLogin('usr','msgUsr')) { 3.634 - alert("$(gettext 'User login error')"); 3.635 - return false; 3.636 - // user pwd 3.637 - } else if (false == checkPwd('userPwd1','userPwd2','msgUserPwd')) { 3.638 - alert("$(gettext 'User password error')"); 3.639 - return false; 3.640 - } else { 3.641 - var r=confirm("$(gettext 'Do you really want to continue?')"); 3.642 - if (r==true) 3.643 - { 3.644 - document.ConfigForm.submit(); 3.645 - } else { 3.646 - return false; 3.647 - } 3.648 - } 3.649 - } else if (page == "write") { 3.650 - return true; 3.651 - } else { 3.652 - var r=confirm("$(gettext 'Do you really want to continue?')"); 3.653 - if (r==true) 3.654 - { 3.655 - document.ConfigForm.submit(); 3.656 - } else { 3.657 - return false; 3.658 - } 3.659 - } 3.660 - } 3.661 -</script> 3.662 -<form name="ConfigForm" method="get" onsubmit="return Validate('$1')" action="$SCRIPT_NAME"> 3.663 -EOT 3.664 -} 3.665 - 3.666 -form_end() 3.667 -{ 3.668 - echo "</form>" 3.669 -} 3.670 - 3.671 -# 3.672 -# Main 3.673 -# 3.674 - 3.675 -case "$(GET page)" in 3.676 - home) 3.677 - xhtml_header 3.678 - select_action 3.679 - select_install 3.680 - select_upgrade 3.681 - ;; 3.682 - partitioning) 3.683 - xhtml_header 3.684 - display_action install 3.685 - select_gparted 3.686 - ;; 3.687 - gparted) 3.688 - su - -c "exec env DISPLAY=':0.0' XAUTHORITY='/var/run/slim.auth' /usr/sbin/gparted" 3.689 - xhtml_header 3.690 - page_redirection partitioning 3.691 - ;; 3.692 - install) 3.693 - xhtml_header 3.694 - form_start install 3.695 - display_action install 3.696 - read_setup 3.697 - select_source 3.698 - select_hdd 3.699 - select_partition 3.700 - select_options 3.701 - select_home 3.702 - select_hostname 3.703 - select_root 3.704 - select_user 3.705 - select_grub 3.706 - moveto_page partitioning write 3.707 - form_end 3.708 - ;; 3.709 - upgrade) 3.710 - xhtml_header 3.711 - form_start upgrade 3.712 - display_action upgrade 3.713 - read_setup 3.714 - select_source 3.715 - select_hdd 3.716 - select_old_slitaz 3.717 - select_options 3.718 - select_grub 3.719 - moveto_page home write 3.720 - form_end 3.721 - ;; 3.722 - write) 3.723 - write_setup 3.724 - xhtml_header 3.725 - if ! (tazinst check $INSTFILE); then 3.726 - page_redirection $(GET INST_ACTION) 3.727 - else 3.728 - read_setup 3.729 - form_start write 3.730 - display_action $(GET INST_ACTION) 3.731 - if run_tazinst; then 3.732 - moveto_page home reboot 3.733 - else 3.734 - moveto_page home failed 3.735 - fi 3.736 - form_end 3.737 - fi 3.738 - ;; 3.739 - reboot) 3.740 - reboot ;; 3.741 - failed) 3.742 - xhtml_header 3.743 - display_log 3.744 - ;; 3.745 - menu_install) 3.746 - xhtml_header 3.747 - if check_ressources; then 3.748 - page_redirection partitioning 3.749 - fi 3.750 - ;; 3.751 - menu_upgrade) 3.752 - xhtml_header 3.753 - if check_ressources; then 3.754 - page_redirection upgrade 3.755 - fi 3.756 - ;; 3.757 - *) 3.758 - xhtml_header 3.759 - if check_ressources; then 3.760 - page_redirection home 3.761 - fi 3.762 - ;; 3.763 -esac 3.764 - 3.765 -xhtml_footer 3.766 - 3.767 -exit 0
4.1 --- a/lib/user.js Sun Feb 17 12:53:34 2013 +0100 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,106 +0,0 @@ 4.4 -/* 4.5 - Login and password validation 4.6 - Copyright (C) 2013 SliTaz GNU/linux - GNU gpl v3 4.7 -*/ 4.8 - 4.9 -//// 4.10 -// i18n for this javascript 4.11 - 4.12 -function i18n(text){ 4.13 - var lang = document.getElementsByTagName("html")[0].getAttribute("lang"); 4.14 - var orig = ["Too short!", "Too long!", "Invalid chars!", "(No Password!)", "(Strong)", "(Medium!)", "(Weak!)", "Do Not Match!"]; 4.15 - var translate = ["es", "fr", "pt", "ru"]; 4.16 - translate['ru'] = ["Слишком короткий!", "Слишком длинный!", "Недопустимые символы!", "(Нет пароля!)", "(Сильный)", "(Средний!)", "(Слабый!)", "Не совпадает!"]; 4.17 - translate['fr'] = [ ]; 4.18 - 4.19 - var output = text; 4.20 - for (var i=0; i<orig.length; i++) { 4.21 - if (translate[lang] !== undefined && orig[i] == text) { 4.22 - var transTry = translate[lang][i]; 4.23 - if (transTry !== undefined && transTry !== '') { 4.24 - var output = transTry; 4.25 - } 4.26 - break 4.27 - } 4.28 - } 4.29 - return(output); 4.30 -} 4.31 - 4.32 -//// 4.33 -// Login validation - typical use: 4.34 -// <input id="login1" onkeyup="checkLogin('login1','msg1'); return false;" /> 4.35 -// <span id="msg1"></span> 4.36 - 4.37 -function checkLogin(user,message){ 4.38 - var login = document.getElementById(user); 4.39 - var msg = document.getElementById(message); 4.40 - var enoughRegex = new RegExp("(?=.{3,}).*", "g"); 4.41 - var incharRegex = new RegExp("^[A-Za-z0-9_-]{3,32}$"); 4.42 - // html fragments 4.43 - var nok='<span class="msg-nok">✖ '; 4.44 - var s='</span>'; 4.45 - 4.46 - if (login.value == '') { 4.47 - msg.innerHTML = ''; 4.48 - } else if (false == enoughRegex.test(login.value)) { 4.49 - msg.innerHTML = nok + i18n('Too short!') + s; 4.50 - return false; 4.51 - } else if (login.value.length > 32) { 4.52 - msg.innerHTML = nok + i18n('Too long!') + s; 4.53 - return false; 4.54 - } else if (false == incharRegex.test(login.value)) { 4.55 - msg.innerHTML = nok + i18n('Invalid chars!') + s; 4.56 - return false; 4.57 - } else { 4.58 - msg.innerHTML = '<span class="msg-ok">✔'+s; 4.59 - } 4.60 -} 4.61 - 4.62 -//// 4.63 -// Password validation - typical use: 4.64 -// <input type="password" id="pass1" onkeyup="checkPwd('pass1','pass2','msg2'); return false;" /> 4.65 -// <input type="password" id="pass2" onkeyup="checkPwd('pass1','pass2','msg2'); return false;" /> 4.66 -// <span id="msg2"></span> 4.67 - 4.68 -function checkPwd(password,confirm,message){ 4.69 - var pwd1 = document.getElementById(password); 4.70 - var pwd2 = document.getElementById(confirm); 4.71 - var msg = document.getElementById(message); 4.72 - // html fragments 4.73 - var nok = '<span class="msg-nok">✖ '; 4.74 - var okw = '<span class="msg-ok">✔ </span><span class="msg-warn">'; 4.75 - var s = '</span>'; 4.76 - 4.77 - if(pwd1.value == pwd2.value){ 4.78 - // passwords match. 4.79 - pwd2.classList.remove('alert'); 4.80 - // various checks 4.81 - var enoughRegex = new RegExp("(?=.{3,}).*", "g"); 4.82 - var incharRegex = new RegExp("^[A-Za-z0-9!@#$%^&*()_]{3,40}$"); 4.83 - var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); 4.84 - var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); 4.85 - if (pwd1.value.length==0) { 4.86 - msg.innerHTML = okw + i18n('(No Password!)') + s; 4.87 - } else if (pwd1.value.length > 40) { 4.88 - msg.innerHTML = nok + i18n('Too long!') + s; 4.89 - return false; 4.90 - } else if (false == enoughRegex.test(pwd1.value)) { 4.91 - msg.innerHTML = nok + i18n('Too short!') + s; 4.92 - return false; 4.93 - } else if (false == incharRegex.test(pwd1.value)) { 4.94 - msg.innerHTML = nok + i18n('Invalid chars!') + s; 4.95 - return false; 4.96 - } else if (strongRegex.test(pwd1.value)) { 4.97 - msg.innerHTML = '<span class="msg-ok">✔ ' + i18n('(Strong)') + s; 4.98 - } else if (mediumRegex.test(pwd1.value)) { 4.99 - msg.innerHTML = okw + i18n('(Medium!)') + s; 4.100 - } else { 4.101 - msg.innerHTML = okw + i18n('(Weak!)') + s; 4.102 - } 4.103 - } else { 4.104 - // passwords do not match. 4.105 - pwd2.classList.add('alert'); 4.106 - msg.innerHTML = nok + i18n('Do Not Match!') + s; 4.107 - return false; 4.108 - } 4.109 -}
5.1 --- a/styles/default/header.html Sun Feb 17 12:53:34 2013 +0100 5.2 +++ b/styles/default/header.html Wed Feb 20 09:44:56 2013 +0100 5.3 @@ -96,12 +96,6 @@ 5.4 <li><a href="/live.cgi#meta">$(gettext 'Build a meta ISO')</a></li> 5.5 </ul> 5.6 </li> 5.7 - <li><a href="/installer.cgi">$(gettext 'Install')</a> 5.8 - <ul> 5.9 - <li><a href="/installer.cgi?page=menu_install">$(gettext 'Install SliTaz')</a></li> 5.10 - <li><a href="/installer.cgi?page=menu_upgrade">$(gettext 'Upgrade system')</a></li> 5.11 - </ul> 5.12 - </li> 5.13 </ul> 5.14 </div> 5.15
6.1 --- a/styles/default/style.css Sun Feb 17 12:53:34 2013 +0100 6.2 +++ b/styles/default/style.css Wed Feb 20 09:44:56 2013 +0100 6.3 @@ -292,10 +292,6 @@ 6.4 span.kernel-id { color: #287FC7; } 6.5 span.kernel-id2 { color: #843523; } 6.6 6.7 -/* alert messages */ 6.8 -span.msg-ok { color: limegreen; } 6.9 -span.msg-nok { color: tomato; } 6.10 - 6.11 /* Misc */ 6.12 6.13 pre, .pre-main {