summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authormichael pereira2011-04-25 13:08:07 +0200
committermichael pereira2011-04-25 13:08:07 +0200
commitd5b319ba583a969dcfaf4f553b309c8fc378d14f (patch)
tree56d77330ad81b0eb9316c893c4b7ca4f129981fd /application
parentconfig fertig (diff)
downloadpbs2-d5b319ba583a969dcfaf4f553b309c8fc378d14f.tar.gz
pbs2-d5b319ba583a969dcfaf4f553b309c8fc378d14f.tar.xz
pbs2-d5b319ba583a969dcfaf4f553b309c8fc378d14f.zip
config fix
Diffstat (limited to 'application')
-rw-r--r--application/controllers/ResourceController.php22
-rw-r--r--application/modules/user/views/scripts/config/index.phtml18
2 files changed, 18 insertions, 22 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php
index d48867a..fa3b214 100644
--- a/application/controllers/ResourceController.php
+++ b/application/controllers/ResourceController.php
@@ -59,7 +59,7 @@ class ResourceController extends Zend_Controller_Action
$session->setBootosID($bootmenuentry->getBootosID())
->setBootmenuentryID($bootmenuentry->getID())
->setTime(time())
- ->setMembershipID($bootmenuMapper->find($bootmenuentry->getBootmenuID())->getMembershipID())
+ ->setMembershipID('1')
->setIp($_SERVER['REMOTE_ADDR'])
->setAlphasessionID('0');
@@ -396,8 +396,11 @@ 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");
+ exec("tar -C $tmp_conf -xvf ../resources/bootos/$bootosID/config/default.tgz",$restul);
+
//exec("cp ../resources/config/loginfiles/* $path_userconf/rootfs/etc/");
+ $username = '';
+ $userpassword = '';
if($this->thisSession->getMembershipID() != null){
$person = new Application_Model_Person();
@@ -409,15 +412,16 @@ class ResourceController extends Zend_Controller_Action
$username = preg_replace("!\s!","",$username);
$userpassword = $person->getLoginPassword();
}
-
- foreach($bootosuser as $user){
- if($user->getLogin == '%username%'){
+
+ foreach($bootosuser as $user){
+
+ if($user->getLogin() == '%username%'){
$loginname = $username;
}else{
$loginname = $user->getLogin();
}
- if($user->getPassword == '%password%'){
+ if($user->getPassword() == '%password%'){
$password = $userpassword;
}else{
$password = $user->getPassword();
@@ -431,9 +435,11 @@ class ResourceController extends Zend_Controller_Action
$homepath = "/home/$loginname";
}
- exec("echo 'chroot /mnt useradd -d ".$homepath." -m -p '".$password."'".$loginname."' >> $tmp_conf/initramfs/postinit.local");
-
+ if($loginname != '' && $password != '')
+ exec("echo 'chroot /mnt useradd -d ".$homepath." -m -p \"".$password."\" ".$loginname."' >> $tmp_conf/initramfs/postinit.local",$restul);
+
}
+
// create the gzipped tarfile.
chdir($tmp_conf);
passthru( "tar cz *");
diff --git a/application/modules/user/views/scripts/config/index.phtml b/application/modules/user/views/scripts/config/index.phtml
index 37f5a9f..8ca5875 100644
--- a/application/modules/user/views/scripts/config/index.phtml
+++ b/application/modules/user/views/scripts/config/index.phtml
@@ -34,7 +34,7 @@
<div class='element'>
<div class='number'>
<div class='smallnumber'>BootOs</div>
- <?php echo $k ?>
+ <?php echo $k+1 ?>
</div>
<div class='content'>
<div class='actions'>
@@ -59,7 +59,7 @@
<?php ?>
<div class='title'><?php echo $this->escape($bootos->getTitle()); ?></div>
<div class='subtitle'><?php echo $this->escape($bootos->getGroupID()); ?> - <?php echo $this->escape($bootos->getDescription()); ?></div>
- <div class='details'>
+ <div class='details dispnone'>
<?php if(count($this->configlist[$bootos->getID()])==0)
echo "There are no Config's to display." ?>
<?php foreach ($this->configlist[$bootos->getID()] as $k => $config): ?>
@@ -110,7 +110,7 @@
</div>
<div class='title'><?php echo $this->escape($config->getTitle()); ?></div>
<div class='subtitle'><?php echo $this->escape($config->getDescription()) ?></div>
- <div class='details'>
+ <div class='details dispnone'>
<?php if(Pbs_Acl::checkRight('csai')): ?>
<label>ConfigID</label>
<div class='item'><?php echo $this->escape($config->getID()); ?></div>
@@ -135,14 +135,4 @@
<?php echo $this->pagination; ?>
-<script type="text/javascript">
-$(document).ready(function(){
- if($('.element').find('.dispnone').length >= 1){
- $(this).find('.title').css('cursor','pointer');
-
- $('.title').click(function(){
- $(this).siblings('.dispnone').toggle();
- });
- }
-});
-</script>
+