--- alx-src/trunk/alxconfig-ng/init.d/alxsettings 2005/04/12 20:46:52 239 +++ alx-src/trunk/alxconfig-ng/init.d/alxsettings 2005/04/13 16:15:28 248 @@ -11,7 +11,7 @@ #%before: #%after: -# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.7 2005-04-12 20:45:55 niro Exp $ +# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.8 2005-04-13 16:15:28 niro Exp $ # checks first if the client was already configured and if it has an valid serial # if not it runs the autoconfiguration script @@ -32,6 +32,7 @@ source /usr/lib/alxconfig-ng/functions/config_printers source /usr/lib/alxconfig-ng/functions/config_sessions source /usr/lib/alxconfig-ng/functions/config_x11 +source /usr/lib/alxconfig-ng/functions/config_auth #check if mysql is available [ -x /usr/bin/mysql ] && MYSQL_ALX=true @@ -47,70 +48,6 @@ [ ! -d /etc/alxconfig-ng/state ] && install -d /etc/alxconfig-ng/state -validate_sessions(){ - - local x i all LOCAL_SESSIONS DB_SESSIONS SETTINGSPATH count - - #all arrays: - # -> session1 session2 ... sessionN - - - #no LOCAL_SESSIONS here, needs bubblesort - - #get settings from database - all=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ - "select session from cfg_sessions where serial='${ALX_SERIAL}'") - - #split'em up and put in an array (only if $all not zero) - declare -i i=0 - if [ -n "${all}" ] - then - for x in ${all} - do - DB_SESSIONS[${i}]=${x} - ((i++)) - done - count=${i} - else - count=0 - fi - - ## no compare here, can only done with bubblesort or s.th like that - # shows only the new sessions - declare -i i=0 - #count=${#DB_SESSIONS[*]} #---> not working gets always 1, why ? - - echo "Number of new sessions: ${count}" - for ((i=0; i < count; i++)) - do - echo "${i} - ${DB_SESSIONS[${i}]}" - done - - #update local configs - SETTINGSPATH=${SETTINGS_TEMPLATE}/menu - declare -i i=0 - - #count=${#DB_SESSIONS[*]} - - if [ ${count} -gt 0 ] - then - #create directory if not exist - [ ! -d ${SETTINGSPATH}/sessions ] && install -d ${SETTINGSPATH}/sessions - - #delete old sessions - echo -n > ${SETTINGSPATH}/sessions/sessions - - for ((i=0; i < count; i++)) - do - echo "${DB_SESSIONS[${i}]}" >> ${SETTINGSPATH}/sessions/sessions - done - - #set update flag - ALX_SESSION_SETUP=true - fi -} - - update_system_settings(){ echo -e ${COLMAGENTA}"Checking system setup ..."${COLDEFAULT} @@ -120,14 +57,14 @@ # imports x11 settings from db config_x11 - #echo - #echo "sessions" - #validate_sessions - #echo + # imports session settings from db config_sessions # imports printer settings from db config_printing + + # imports auth settings from db + config_auth } get_system_serial(){