Changeset 3151


Ignore:
Timestamp:
05/25/12 15:08:44 (12 months ago)
Author:
squidly
Message:

Correction classe de gestion des htaccess

Location:
alternc/trunk/bureau
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • alternc/trunk/bureau/admin/hta_doedituser.php

    r2688 r3151  
    5353<br /> 
    5454<?php 
    55         if ($error) { 
     55        if (isset($error) && $error) { 
    5656                echo "<p class=\"error\">$error</p>"; 
    5757        } 
  • alternc/trunk/bureau/admin/hta_list.php

    r2998 r3151  
    4343<br /> 
    4444<?php 
    45         if ($error) { 
     45        if (isset($error) && $error) { 
    4646                echo "<p class=\"error\">$error</p>"; 
    4747        } 
  • alternc/trunk/bureau/class/m_hta.php

    r2998 r3151  
    105105   * @return array Array containing user folder list 
    106106   */ 
    107   function ListDir() { 
    108     global $err,$mem,$L_ALTERNC_LOC; 
    109     $err->log("hta","listdir"); 
    110     $sortie=array(); 
    111     $absolute="$L_ALTERNC_LOC/html/".substr($mem->user["login"],0,1)."/".$mem->user["login"]; 
    112     exec("find $absolute -name .htpasswd | sort", $sortie); 
    113     if (!count($sortie)) { 
    114       $err->raise("hta",4); 
    115       return false; 
    116     } 
    117     for ($i=0;$i<count($sortie);$i++){ 
    118       preg_match("/^".addslashes("$L_ALTERNC_LOC/html/")."\/.\/[^\/]*\/(.*)\/\.htpasswd/", $sortie[$i], $matches); 
    119       $r[$i]=$matches[1]."/"; 
    120     } 
    121     return $r; 
    122   } 
    123  
     107 
     108  function ListDir(){ 
     109          global$err,$mem,$L_ALTERNC_LOC; 
     110          $err->log("hta","listdir"); 
     111          $sortie=array(); 
     112          $absolute="$L_ALTERNC_LOC/html/".substr($mem->user["login"],0,1)."/".$mem->user["login"]; 
     113          exec("find $absolute -name .htpasswd|sort",$sortie); 
     114          if(!count($sortie)){ 
     115                  $err->raise("hta",4); 
     116                  return false; 
     117          } 
     118          $pattern="/^".preg_quote($L_ALTERNC_LOC,"/")."\/html\/.\/[^\/]*\/(.*)\/\.htpasswd/"; 
     119                  for($i=0;$i<count($sortie);$i++){ 
     120                  preg_match($pattern,$sortie[$i],$matches); 
     121                  $r[$i]=$matches[1]."/"; 
     122          } 
     123          return $r; 
     124  } 
    124125 
    125126  /*---------------------------------------------------------------------------*/ 
     
    192193      return false; 
    193194    } 
    194     if (!unlink("$dir/.htaccess")) { 
     195    if (!@unlink("$dir/.htaccess")) { 
    195196      $err->raise("hta",5,$dir); 
    196197      return false; 
    197198    } 
    198     if (!unlink("$dir/.htpasswd")) { 
     199    if (!@unlink("$dir/.htpasswd")) { 
    199200      $err->raise("hta",6,$dir); 
    200201      return false; 
     
    315316    // Check this password against the password policy using common API :  
    316317    if (is_callable(array($admin,"checkPolicy"))) { 
    317       if (!$admin->checkPolicy("hta",$user,$password)) { 
     318      if (!$admin->checkPolicy("hta",$user,$newpass)) { 
    318319        return false; // The error has been raised by checkPolicy() 
    319320      } 
Note: See TracChangeset for help on using the changeset viewer.