# HG changeset patch # User Dominique Corbex # Date 1361349896 -3600 # Node ID 7b6cf90e0155aab6c58b58a8f8ce4ae4270e5b34 # Parent 972b3169b3e4953e158621757caabb81b3ca9287 move tazint to its own repo diff -r 972b3169b3e4 -r 7b6cf90e0155 AUTHORS --- a/AUTHORS Sun Feb 17 12:53:34 2013 +0100 +++ b/AUTHORS Wed Feb 20 09:44:56 2013 +0100 @@ -1,6 +1,5 @@ Christophe Lincoln Pascal Bellard Paul Issot -Dominique Corbex Christian Mesh Aleksej Bobylev diff -r 972b3169b3e4 -r 7b6cf90e0155 Makefile --- a/Makefile Sun Feb 17 12:53:34 2013 +0100 +++ b/Makefile Wed Feb 20 09:44:56 2013 +0100 @@ -17,8 +17,8 @@ --package-name="TazPanel" \ --package-version="$(VERSION)" \ ./tazpanel ./index.cgi ./pkgs.cgi ./live.cgi ./network.cgi ./boot.cgi \ - ./hardware.cgi ./settings.cgi ./lib/libtazpanel ./installer.cgi \ - ./help.cgi ./styles/default/header.html ./styles/default/footer.html + ./hardware.cgi ./settings.cgi ./lib/libtazpanel ./help.cgi \ + ./styles/default/header.html ./styles/default/footer.html msgmerge: @for l in $(LINGUAS); do \ diff -r 972b3169b3e4 -r 7b6cf90e0155 installer.cgi --- a/installer.cgi Sun Feb 17 12:53:34 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,764 +0,0 @@ -#!/bin/sh -# -# Main CGI interface for Tazinst, the SliTaz installer. -# -# Copyright (C) 2012 SliTaz GNU/Linux - BSD License -# -# Authors : Dominique Corbex -# - -VERSION=0.30 - -# Common functions from libtazpanel -. lib/libtazpanel -header -get_config - -# Include gettext helper script. -. /usr/bin/gettext.sh - -# Export package name for gettext. -#TEXTDOMAIN='installer' -#export TEXTDOMAIN - -TITLE=$(gettext 'TazPanel - Installer') - -# Tazinst required version -TAZINST_REQUIRED_VERSION="3.3" - -# Tazinst setup file -INSTFILE=/var/lib/tazinst.conf - - -write_setup() -{ - if [ -e "$INSTFILE" ]; then - # Install type - INST_TYPE=$(GET INST_TYPE) - # Source File - case "$INST_TYPE" in - usb) - SRC_FILE=$(GET SRC_USB) ;; - iso) - SRC_FILE=$(GET SRC_ISO) ;; - web) - SRC_FILE=$(GET SRC_WEB) ;; - esac - SRC_FILE=$(echo "$SRC_FILE" | sed 's/\//\\\//'g) - [ -n $(GET URL) ] && SRC_WEB=$(GET URL) - # Main Partition - TGT_PARTITION=$(echo "$(GET TGT_PARTITION)" | sed 's/\//\\\//'g) - [ -n "$(GET MAIN_FMT)" ] && TGT_FS=$(GET MAIN_FS) || TGT_FS="" - # Home Partition - if [ -n "$(GET HOME_SELECT)" ] ; then - TGT_HOME=$(echo "$(GET TGT_HOME)" | sed 's/\//\\\//'g) - [ -n "$(GET HOME_FMT)" ] && TGT_HOME_FS=$(GET HOME_FS) || TGT_HOME_FS="" - else - TGT_HOME="" - TGT_HOME_FS="" - fi - # Hostname - TGT_HOSTNAME=$(GET TGT_HOSTNAME) - # Root pwd - TGT_ROOT_PWD=$(GET TGT_ROOT_PWD) - # User Login - TGT_USER=$(GET TGT_USER) - # User Pwd - TGT_USER_PWD=$(GET TGT_USER_PWD) - # Grub - TGT_GRUB=$(GET TGT_GRUB) - [ "$TGT_GRUB" == "yes" ] || TGT_GRUB=no - # Win Dual-Boot - TGT_WINBOOT=$(GET TGT_WINBOOT) - - # Save changes to INSTFILE - sed -i s/"^INST_TYPE=.*"/"INST_TYPE=\"$INST_TYPE\"/" $INSTFILE - sed -i s/"^SRC_FILE=.*"/"SRC_FILE=\"$SRC_FILE\"/" $INSTFILE - sed -i s/"^TGT_PARTITION=.*"/"TGT_PARTITION=\"$TGT_PARTITION\"/" $INSTFILE - sed -i s/"^TGT_FS=.*"/"TGT_FS=\"$TGT_FS\"/" $INSTFILE - sed -i s/"^TGT_HOME=.*"/"TGT_HOME=\"$TGT_HOME\"/" $INSTFILE - sed -i s/"^TGT_HOME_FS=.*"/"TGT_HOME_FS=\"$TGT_HOME_FS\"/" $INSTFILE - sed -i s/"^TGT_HOSTNAME=.*"/"TGT_HOSTNAME=\"$TGT_HOSTNAME\"/" $INSTFILE - sed -i s/"^TGT_ROOT_PWD=.*"/"TGT_ROOT_PWD=\"$TGT_ROOT_PWD\"/" $INSTFILE - sed -i s/"^TGT_USER=.*"/"TGT_USER=\"$TGT_USER\"/" $INSTFILE - sed -i s/"^TGT_USER_PWD=.*"/"TGT_USER_PWD=\"$TGT_USER_PWD\"/" $INSTFILE - sed -i s/"^TGT_GRUB=.*"/"TGT_GRUB=\"$TGT_GRUB\"/" $INSTFILE - sed -i s/"^TGT_WINBOOT=.*"/"TGT_WINBOOT=\"$TGT_WINBOOT\"/" $INSTFILE - fi -} - -read_setup() -{ - # various checks on setup file - if [ -e "$INSTFILE" ]; then - # validity check + reformat output - tazinst check $INSTFILE | awk ' -BEGIN{ - fmt1="" - fmt2="
" - OFS="" - } -{ - # make html compliant - str=$0 - gsub(/\[1m/,"",str) - gsub(/\[0m/,"",str) - gsub(/\s/,"\\ ",str) - gsub(//,"\\>",str) - a[i++]=str -} END { - {print fmt1,a[i-1],fmt2} - {for (j=0; j$(gettext 'Setup File Error')
-$(eval_gettext "The setup file \$INSTFILE doesn't \ -exist.")
-EOT - else - if [ ! -r $INSTFILE ]; then - cat <$(gettext 'Setup File Error')
-$(eval_gettext "The setup file $INSTFILE is not readable. \ -Check permissions and ownership.")
-EOT - fi - fi - fi - # read setup file - . $INSTFILE -} - -select_action() -{ - cat < -

$(gettext 'SliTaz Installer')

- -

$(gettext "The SliTaz Installer installs or upgrades SliTaz to a hard disk \ -drive from a device like a Live-CD or LiveUSB key, from a SliTaz ISO file, or \ -from the web by downloading an ISO file.")

- -EOT -} - -select_install() -{ - cat < -

$(gettext 'Install')

- -

$(gettext "Install SliTaz on a partition of your hard disk drive. If you \ -decide to format your partition, all data will be lost. If you do not format, \ -all data except for any existing /home directory will be removed (note the home \ -directory contents will be kept as is).")

- -

$(gettext "Before installation, you may need to create or resize partitions \ -on your hard disk drive in order to make space for SliTaz GNU/Linux. You can \ -graphically manage your partitions with Gparted.")

- -$(gettext "Install \ -SliTaz") - -EOT -} - -select_upgrade() -{ - cat < -

$(gettext 'Upgrade')

- -

$(gettext "Upgrade an already installed SliTaz system on your hard disk \ -drive. Your /home /etc /var/www directories will be kept, all other \ -directories will be removed. Any additional packages added to your old Slitaz \ -system will be updated as long you have an active internet connection.")

- -$(gettext "Upgrade \ -SliTaz") - -EOT -} - -select_gparted() -{ - cat <$(gettext 'Partitioning') -
- -

$(gettext "On most used systems, the hard drive is already dedicated to \ -partitions for Windows, or Linux, or another operating \ -system. You'll need to resize these partitions in order to make space for \ -SliTaz GNU/Linux. SliTaz will co-exist with other operating systems already \ -installed on your hard drive.")

- -

$(gettext "The amount of space needed depends on how much software you plan \ -to install and how much space you require for users. It's conceivable that you \ -could run a minimal SliTaz system in 300 megs or less, but 2 gigs is indeed \ -more comfy.")

- -

$(gettext "A separate home partition, and a partition that will be used as \ -Linux swap space may be created if needed. Slitaz detects and uses swap \ -partitions automatically.")

- -
- -
- -

$(gettext "You can graphically manage your partitions with Gparted. GParted \ -is a partition editor for graphically managing your disk partitions. Gparted \ -allows you to create, destroy, resize and copy partitions without data loss.")

- -

$(gettext "Gparted supports ext2, ext3, ext4, linux swap, ntfs and fat32 \ -filesystems right out of the box. Support for xjs, jfs, hfs and other \ -filesystems is available as well but you first need to add drivers for these \ -filesystems by installing the related packages xfsprogs, jfsutils, linux-hfs \ -and so on.")

-
- -$(gettext 'Execute Gparted') - -
$(gettext 'Continue installation')
- -

$(gettext "Once you've made room for SliTaz on your drive, you should be \ -able to continue installation.") - -


- - $(gettext 'Back to Installer Start Page') - - $(gettext 'Continue Installation') -EOT -} - -display_action() -{ - case $1 in - install) - cat << EOT -
-

$(gettext 'Install SliTaz')

- -

$(gettext "You're going to install SliTaz on a partition of your hard disk \ -drive. If you decide to format your HDD, all data will be lost. If you do not \ -format, all data except for any existing /home directory will be removed (note the \ -home directory contents will be kept as is)."

-

- -EOT - ;; - upgrade) - cat << EOT -
-

$(gettext 'Upgrade SliTaz')

- -

$(gettext "You're going to upgrade an already installed SliTaz system on \ -your hard disk drive. Your /home /etc /var/www directories will be kept, all \ -other directories will be removed. Any additional packages added to your old \ -Slitaz system will be updated as long you have an active internet connection.")

-

- -EOT - ;; - esac -} - -select_source() -{ - cat <$(gettext 'Slitaz source media') - -
- - -
- - -
- - - -
- - -
-EOT -} - -select_hdd() -{ -cat <$(gettext 'Hard Disk Drive') -EOT -} - -select_partition() -{ - cat < - -$(gettext 'Install Slitaz to partition:') - -
- - - -EOT - # List partitions - if fdisk -l | grep -q ^/dev/ ; then - echo "" - for i in $(blkid | cut -d ":" -f 1); do - echo "" - done - else - echo "" - fi - cat < - -EOT -} - -select_options() -{ - cat <$(gettext 'Options') -EOT -} - -select_home() -{ - cat < -
$(gettext 'home partition')
- - - - - - - - -EOT -} - -select_root() -{ -cat << EOT -
-
$(gettext 'Root')
- - $(gettext 'Root passwd:') - - - $(gettext 'Confirm password:') - - - -
-EOT -} - -select_user() -{ -cat << EOT -
-
$(gettext 'User')
- - $(gettext 'User login:') - - -

- - $(gettext 'User passwd:') - - - $(gettext 'Confirm password:') - - -
-EOT -} - -select_grub() -{ -cat << EOT -
-
$(gettext 'Grub')
- - - - - -
-EOT -} - -moveto_page() -{ - case $1 in - partitioning) - title1=" $(gettext 'Back to partitioning')" ;; - *) - page=home - title1=" $(gettext 'Back to Installer Start Page')" ;; - esac - case $2 in - write|run) - title2="$(gettext 'Proceed to SliTaz installation') " ;; - reboot) - title2=$(gettext 'Installation complete. You can now restart (reboot)') ;; - failed) - title2=$(gettext 'Installation failed. See log') ;; - *) - page=home - title2=" $(gettext 'Back to Installer Start Page')" ;; - esac - cat < -$title1 -$title2 -EOT -} - -page_redirection() -{ - cat << EOT - - - - -$(gettext "A web page that points a browser to a different page after \ -2 seconds") - - - - -

$(gettext "If your browser doesn't automatically redirect within a few \ -seconds, you may want to go there manually")

-

$1

- - -EOT -} - -check_ressources() -{ - local code - code=0 - # Check tazinst - if ! [ -x /usr/sbin/tazinst ] ; then - cat <$(gettext 'Tazinst Error') -

$(gettext "tazinst, the lightweight SliTaz HDD installer \ -is missing. Any installation cannot be done without tazinst.")

- -

$(gettext "Check tazinst' permissions, or reinstall the slitaz-tools \ -package:")

-# tazpkg get-install slitaz-tools --forced -EOT - code=1 - else - # Check tazinst required version - v=$(tazinst version | tr -d '[:alpha:]') - r=$TAZINST_REQUIRED_VERSION - if ! (echo "$v" | awk -v r=$r '{v=$v+0}{ if (v < r) exit 1}') ; then - cat <$(gettext 'Tazinst Error') - -

$(eval_gettext "tazinst ($v) is not at the required \ -version ($r), use tazinst in a xterm or reinstall the slitaz-tools package:")

-# tazpkg get-install slitaz-tools --forced -EOT - code=1 - fi - fi - return $code -} - -run_tazinst() -{ - cat << EOT -

$(gettext 'Proceeding: ()')

-

$(gettext 'Please wait until processing is complete')

-EOT - table_start - tazinst $(GET INST_ACTION) $INSTFILE | \ - awk '{print "" $0 ""}' - table_end - echo "

$(gettext 'Completed.')

" - return $(grep -c "cancelled on error" $INSTFILE) -} - -tazinst_log() -{ - echo "
$(tazinst log)
" -} - -scan_mkfs() -{ - for path in /bin /sbin /usr/bin /usr/sbin - do - [ -e $path/mkfs.btrfs ] && FS=btrfs - [ -e $path/mkfs.cramfs ] && FS="$FS cramfs" - [ -e $path/mkfs.ext2 ] && FS="$FS ext2" - [ -e $path/mkfs.ext3 ] && FS="$FS ext3" - [ -e $path/mkfs.ext4 ] && FS="$FS ext4" - [ -e $path/mkfs.jfs ] && FS="$FS jfs" - [ -e $path/mkfs.minix ] && FS="$FS minix" - [ -e $path/mkfs.reiserfs ] && FS="$FS reiserfs" - [ -e $path/mkfs.xfs ] && FS="$FS xfs" - done -} - -form_start() -{ - cat < - -
-EOT -} - -form_end() -{ - echo "
" -} - -# -# Main -# - -case "$(GET page)" in - home) - xhtml_header - select_action - select_install - select_upgrade - ;; - partitioning) - xhtml_header - display_action install - select_gparted - ;; - gparted) - su - -c "exec env DISPLAY=':0.0' XAUTHORITY='/var/run/slim.auth' /usr/sbin/gparted" - xhtml_header - page_redirection partitioning - ;; - install) - xhtml_header - form_start install - display_action install - read_setup - select_source - select_hdd - select_partition - select_options - select_home - select_hostname - select_root - select_user - select_grub - moveto_page partitioning write - form_end - ;; - upgrade) - xhtml_header - form_start upgrade - display_action upgrade - read_setup - select_source - select_hdd - select_old_slitaz - select_options - select_grub - moveto_page home write - form_end - ;; - write) - write_setup - xhtml_header - if ! (tazinst check $INSTFILE); then - page_redirection $(GET INST_ACTION) - else - read_setup - form_start write - display_action $(GET INST_ACTION) - if run_tazinst; then - moveto_page home reboot - else - moveto_page home failed - fi - form_end - fi - ;; - reboot) - reboot ;; - failed) - xhtml_header - display_log - ;; - menu_install) - xhtml_header - if check_ressources; then - page_redirection partitioning - fi - ;; - menu_upgrade) - xhtml_header - if check_ressources; then - page_redirection upgrade - fi - ;; - *) - xhtml_header - if check_ressources; then - page_redirection home - fi - ;; -esac - -xhtml_footer - -exit 0 diff -r 972b3169b3e4 -r 7b6cf90e0155 lib/user.js --- a/lib/user.js Sun Feb 17 12:53:34 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* - Login and password validation - Copyright (C) 2013 SliTaz GNU/linux - GNU gpl v3 -*/ - -//// -// i18n for this javascript - -function i18n(text){ - var lang = document.getElementsByTagName("html")[0].getAttribute("lang"); - var orig = ["Too short!", "Too long!", "Invalid chars!", "(No Password!)", "(Strong)", "(Medium!)", "(Weak!)", "Do Not Match!"]; - var translate = ["es", "fr", "pt", "ru"]; - translate['ru'] = ["Слишком короткий!", "Слишком длинный!", "Недопустимые символы!", "(Нет пароля!)", "(Сильный)", "(Средний!)", "(Слабый!)", "Не совпадает!"]; - translate['fr'] = [ ]; - - var output = text; - for (var i=0; i -// - -function checkLogin(user,message){ - var login = document.getElementById(user); - var msg = document.getElementById(message); - var enoughRegex = new RegExp("(?=.{3,}).*", "g"); - var incharRegex = new RegExp("^[A-Za-z0-9_-]{3,32}$"); - // html fragments - var nok='✖ '; - var s=''; - - if (login.value == '') { - msg.innerHTML = ''; - } else if (false == enoughRegex.test(login.value)) { - msg.innerHTML = nok + i18n('Too short!') + s; - return false; - } else if (login.value.length > 32) { - msg.innerHTML = nok + i18n('Too long!') + s; - return false; - } else if (false == incharRegex.test(login.value)) { - msg.innerHTML = nok + i18n('Invalid chars!') + s; - return false; - } else { - msg.innerHTML = '✔'+s; - } -} - -//// -// Password validation - typical use: -// -// -// - -function checkPwd(password,confirm,message){ - var pwd1 = document.getElementById(password); - var pwd2 = document.getElementById(confirm); - var msg = document.getElementById(message); - // html fragments - var nok = '✖ '; - var okw = ''; - var s = ''; - - if(pwd1.value == pwd2.value){ - // passwords match. - pwd2.classList.remove('alert'); - // various checks - var enoughRegex = new RegExp("(?=.{3,}).*", "g"); - var incharRegex = new RegExp("^[A-Za-z0-9!@#$%^&*()_]{3,40}$"); - var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); - var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); - if (pwd1.value.length==0) { - msg.innerHTML = okw + i18n('(No Password!)') + s; - } else if (pwd1.value.length > 40) { - msg.innerHTML = nok + i18n('Too long!') + s; - return false; - } else if (false == enoughRegex.test(pwd1.value)) { - msg.innerHTML = nok + i18n('Too short!') + s; - return false; - } else if (false == incharRegex.test(pwd1.value)) { - msg.innerHTML = nok + i18n('Invalid chars!') + s; - return false; - } else if (strongRegex.test(pwd1.value)) { - msg.innerHTML = '✔ ' + i18n('(Strong)') + s; - } else if (mediumRegex.test(pwd1.value)) { - msg.innerHTML = okw + i18n('(Medium!)') + s; - } else { - msg.innerHTML = okw + i18n('(Weak!)') + s; - } - } else { - // passwords do not match. - pwd2.classList.add('alert'); - msg.innerHTML = nok + i18n('Do Not Match!') + s; - return false; - } -} diff -r 972b3169b3e4 -r 7b6cf90e0155 styles/default/header.html --- a/styles/default/header.html Sun Feb 17 12:53:34 2013 +0100 +++ b/styles/default/header.html Wed Feb 20 09:44:56 2013 +0100 @@ -96,12 +96,6 @@
  • $(gettext 'Build a meta ISO')
  • -
  • $(gettext 'Install') - -
  • diff -r 972b3169b3e4 -r 7b6cf90e0155 styles/default/style.css --- a/styles/default/style.css Sun Feb 17 12:53:34 2013 +0100 +++ b/styles/default/style.css Wed Feb 20 09:44:56 2013 +0100 @@ -292,10 +292,6 @@ span.kernel-id { color: #287FC7; } span.kernel-id2 { color: #843523; } -/* alert messages */ -span.msg-ok { color: limegreen; } -span.msg-nok { color: tomato; } - /* Misc */ pre, .pre-main {