Changeset 3183


Ignore:
Timestamp:
06/19/12 17:29:15 (11 months ago)
Author:
squidly
Message:

Modification script gestion ACLS + classe browser

Location:
alternc/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • alternc/trunk/bureau/class/m_bro.php

    r3170 r3183  
    472472   * @return boolean TRUE si les fichiers ont t renomms, FALSE si une erreur s'est produite. 
    473473   */ 
    474   function ChangePermissions($R,$d,$perm,$verbose=true) { 
     474  function ChangePermissions($R,$d,$perm,$verbose=false) { 
    475475    global $err; 
    476476    $absolute=$this->convertabsolute($R,0); 
     
    545545  function ExtractFile($file, $dest=null) 
    546546  { 
    547     global $err; 
     547    global $err,$cuid,$mem,$L_ALTERNC_LOC; 
    548548    $file = $this->convertabsolute($file,0); 
    549549    if (is_null($dest)) { 
     
    557557    } 
    558558    $file = escapeshellarg($file); 
    559     $dest = escapeshellarg($dest); 
     559        $dest = escapeshellarg($dest); 
     560        $dest_to_fix=str_replace($L_ALTERNC_LOC."/html/".substr($mem->user["login"],0,1)."/".$mem->user["login"],'',$dest); 
     561          
    560562    // TODO new version of tar supports `tar xf ...` so there is no 
    561563    //     need to specify the compression format 
     
    575577      $err->raise("bro","could not find a way to extract file %s, unsupported format?", $file); 
    576578    } 
    577  
     579         
     580        //fix the perms of the extracted archive 
     581        exec("sudo /usr/lib/alternc/fixperms.sh -u ".$cuid." -d ".$dest_to_fix); 
    578582    return $ret; 
    579583  } 
     
    713717    $dir=str_replace("%2F", "/", urlencode($dir)); 
    714718    $name=urlencode($name); 
    715     if (!$this->cacheurl["d".$dir]) { 
     719    if (!@$this->cacheurl["d".$dir]) { 
    716720      // On parcours $dir en remontant les / 
    717721      $end="";  $beg=$dir;      $tofind=true; 
  • alternc/trunk/src/fixperms.sh

    r3170 r3183  
    107107 
    108108      # Set the file readable only for the AlternC User 
    109       chown -R $GID:$GID "$REP" 
     109      chown -R alterncpanel:$GID "$REP" 
    110110      chmod 2770 -R "$REP" 
    111111 
    112112      # Delete existings ACL 
    113113      # Set the defaults acl on all the files 
    114       setfacl -b -k -m d:g:alterncpanel:rwx -m d:u:$GID:rw- -m d:g:$GID:rw- \ 
    115                     -Rm   g:alterncpanel:rwx -m   u:$GID:rw- -m   g:$GID:rw- \ 
     114      setfacl -b -k -n -R -m d:g:alterncpanel:rwx -m d:u::rwx -m d:g::rwx -m d:u:$GID:rwx -m d:g:$GID:rwx -m d:o::--- -m d:mask:rwx\ 
     115                    -Rm   g:alterncpanel:rwx -m u:$GID:rwx -m g:$GID:rwx -m mask:rwx\ 
    116116               "$REP" 
    117117 
     
    125125        echo "gid: $GID" 
    126126        echo "file: $file" 
    127         chown $GID:$GID $file 
     127        chown alterncpanel:$GID $file 
    128128        chmod 0770 $file 
    129129        /usr/bin/setfacl  -m u:$GID:rw- -m g:$GID:rw- -m g:alterncpanel:rw- -m u:$GID:rw- -m g:$GID:rw- $file 
Note: See TracChangeset for help on using the changeset viewer.