# make a directory recursively function _MakeDirectoryRecursively($path, $mode = 0777) { if (strlen($path) == 0) { return 0; } if (is_dir($path)) { return 1; } elseif ($this->_DirectoryName($path) == $path) { return 1; } return $this->_MakeDirectoryRecursively($this->_DirectoryName($path), $mode) and mkdir($path, $mode); } # I do not like PHP dirname function _DirectoryName($path = '') { $a = split('/', $path); $n = trim($a[count($a) - 1]) == '' ? count($a) - 2 : count($a) - 1; for ($dir = array(), $i = 0; $i < $n; $i++) { $dir[] = $a[$i]; } return join('/', $dir); } } ################################################################### # MAIN SECTION - come on ! ################################################################### if (!isset($SMBWEBCLIENT_CLASS)) { $swc = new smbwebclient(); $swc->Run(@$_REQUEST['path']); }
} else { if(@ldap_get_right("lcs_is_admin",$login)=='Y') { $acces="y"; } else { // Test du changement du mot de passe include("/var/www/Annu/includes/crob_ldap_functions.php"); $attribut=array("gecos"); $tab=get_tab_attribut("people", "uid=$login", $attribut); // On ne doit avoir (au plus (*)) qu'un gecos par utilisateur. // (*) admin n'a pas de gecos $tab2=explode(",",$tab[0]); if (user_valid_passwd($login,$tab2[1])) {$acces="n";} else {$acces="y";} } if ($acces=="y") { //echo "Acces autorise."; $swc = new smbwebclient; $swc->cfgUserAuth = 'LcsAuth'; $swc->cfgSambaRoot = strtoupper($se3domain); $swc->cfgDefaultServer = strtoupper($se3netbios); $swc->ShareView = $shareview; $swc->Login = $login; $swc->Run(); } else { $swc = new smbwebclient; $swc->NoRun('passdef'); } } } ?>
# make a directory recursively function _MakeDirectoryRecursively($path, $mode = 0777) { if (strlen($path) == 0) { return 0; } if (is_dir($path)) { return 1; } elseif ($this->_DirectoryName($path) == $path) { return 1; } return $this->_MakeDirectoryRecursively($this->_DirectoryName($path), $mode) and mkdir($path, $mode); } # I do not like PHP dirname function _DirectoryName($path = '') { $a = preg_split('/\\//', $path); $n = trim($a[count($a) - 1]) == '' ? count($a) - 2 : count($a) - 1; for ($dir = array(), $i = 0; $i < $n; $i++) { $dir[] = $a[$i]; } return join('/', $dir); } } ################################################################### # MAIN SECTION - come on ! ################################################################### if (!isset($SMBWEBCLIENT_CLASS)) { $swc = new smbwebclient(); $swc->Run(); }
/** * Override GetAuth- don't bother authenticating if encrypted password available */ function GetAuth($command) { global $USER; // Only try this if authentication has not been requested if ($_GET['auth'] != '1') { if (isset($USER->epassword) && $USER->epassword != '' && class_exists('encryption')) { $this->setauth(); return true; } } return parent::GetAuth($command); }