From 54d6157376b31691b145ca29ac91a20b435f1456 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Tue, 26 Apr 2011 10:59:01 +0200 Subject: home on usb and draggable bootmenulist --- application/controllers/ResourceController.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'application/controllers/ResourceController.php') diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index 1c28d12..9d7af7f 100644 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -395,9 +395,9 @@ class ResourceController extends Zend_Controller_Action $hash = md5(microtime(1)); $tmp_conf = "../resources/config/$hash"; mkdir($tmp_conf ,0777, true); - exec("tar -C $tmp_conf -xvf ../resources/bootos/$bootosID/config/default.tgz",$restul); + exec("tar -C $tmp_conf -xf ../resources/bootos/$bootosID/config/default.tgz",$restul); + exec("tar -C $tmp_conf/rootfs/ -xf ../resources/config/etc.tgz"); - //exec("cp ../resources/config/loginfiles/* $path_userconf/rootfs/etc/"); $username = ''; $userpassword = ''; @@ -429,20 +429,23 @@ class ResourceController extends Zend_Controller_Action if($user->getHometypeID() == 2){ $homepath = $user->getHomepath(); }elseif($user->getHometypeID() == 1){ - $homepath = "/home/$loginname"; + $homepath = "/media/openslx-stick/home/$loginname"; }else{ $homepath = "/home/$loginname"; } - if($loginname != '' && $password != '') - exec("echo 'chroot /mnt useradd -d ".$homepath." -m -p \"".$password."\" ".$loginname."' >> $tmp_conf/initramfs/postinit.local",$restul); - + if($loginname != '' && $password != ''){ + if($user->getHometypeID() == 1) + exec("echo 'if [ -d /media/openslx-stick ] then \n\t if [ ! -d /media/openslx-stick/home/".$loginname." ] then \n\t\t chroot /mnt useradd -d ".$homepath." -m -s /bin/bash -p \"".$password."\" ".$loginname." \n\t else \n\t\t chroot /mnt useradd -d ".$homepath." -s /bin/bash -p \"".$password."\" ".$loginname." \n\t fi \n else \n\t chroot /mnt useradd -d /home/".$loginname." -m -s /bin/bash -p \"".$password."\" ".$loginname." \n fi' >> $tmp_conf/initramfs/postinit.local"); + else + exec("echo 'chroot /mnt useradd -d ".$homepath." -m -s /bin/bash -p \"".$password."\" ".$loginname."' >> $tmp_conf/initramfs/postinit.local",$restul); + } } // create the gzipped tarfile. chdir($tmp_conf); passthru( "tar cz *"); - exec("rm -rf $tmp_conf"); + exec("rm -rf ../$hash"); } }else{ -- cgit v1.2.3-55-g7522