Changeset 3151
- Timestamp:
- 05/25/12 15:08:44 (13 months ago)
- Location:
- alternc/trunk/bureau
- Files:
-
- 3 edited
-
admin/hta_doedituser.php (modified) (1 diff)
-
admin/hta_list.php (modified) (1 diff)
-
class/m_hta.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
alternc/trunk/bureau/admin/hta_doedituser.php
r2688 r3151 53 53 <br /> 54 54 <?php 55 if ( $error) {55 if (isset($error) && $error) { 56 56 echo "<p class=\"error\">$error</p>"; 57 57 } -
alternc/trunk/bureau/admin/hta_list.php
r2998 r3151 43 43 <br /> 44 44 <?php 45 if ( $error) {45 if (isset($error) && $error) { 46 46 echo "<p class=\"error\">$error</p>"; 47 47 } -
alternc/trunk/bureau/class/m_hta.php
r2998 r3151 105 105 * @return array Array containing user folder list 106 106 */ 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 } 124 125 125 126 /*---------------------------------------------------------------------------*/ … … 192 193 return false; 193 194 } 194 if (! unlink("$dir/.htaccess")) {195 if (!@unlink("$dir/.htaccess")) { 195 196 $err->raise("hta",5,$dir); 196 197 return false; 197 198 } 198 if (! unlink("$dir/.htpasswd")) {199 if (!@unlink("$dir/.htpasswd")) { 199 200 $err->raise("hta",6,$dir); 200 201 return false; … … 315 316 // Check this password against the password policy using common API : 316 317 if (is_callable(array($admin,"checkPolicy"))) { 317 if (!$admin->checkPolicy("hta",$user,$ password)) {318 if (!$admin->checkPolicy("hta",$user,$newpass)) { 318 319 return false; // The error has been raised by checkPolicy() 319 320 }
Note: See TracChangeset
for help on using the changeset viewer.
