Simple Multi User Managed Directory 0.00063
SMUMD
source/install/secure/index.php-Dateireferenz

gehe zum Quellcode dieser Datei

Funktionen

 deleteuserformlist ()
 deleteuser ($uname)
 createanewuser ($uname, $ulogin, $upass, $upassproof)

Variablen

 $Version = "00004"
 $used ["pathnow"] = $SERVER_ROOT.$INSTALL_DIR. $FS .$SECURE_DIR
 $doorder = ""
if(isset($_POST['masterpass'])) $out ["menu"]

Dokumentation der Funktionen

createanewuser ( uname,
ulogin,
upass,
upassproof 
)

Definiert in Zeile 150 der Datei index.php.

Benutzt $debugging, $FS, $out und $used.

                                                           {
        global $out;
        global $used;
        global $FS;
        global $debugging;
        $newuserwritten = false;
        if ($upass == $upassproof) {
                if (!$fh = fopen($used["userlogindb"], 'a')) {
                         $out["errors"] .= "Cannot open userlogin db file to append stuff  <br>";
                } else {
                        $theusernametag = "<username>".$uname."</username>";
                        $usermd5ulogin = md5($ulogin);
                        $theuserlogintag ="<userlogin>".$usermd5ulogin."</userlogin>";
                        $usermd5upass = md5($upass."isadmin");
                        $theuserpasstag ="<userpass>".$usermd5upass."</userpass>";
                        $taggedline = $theusernametag.$theuserlogintag.$theuserpasstag;
                        $addnewuserline = $taggedline."\n";
                        if (fwrite($fh, $addnewuserline) === FALSE) {
                                $out["errors"] .= "Cannot write to userlogin db file to append stuff <br>";
                        } else {
                                $newuserwritten = true;
                        }
                        fclose($fh);
                }
        } else {
                $out["errors"] .= "passwords missmatch error <br>";
        }
        return $newuserwritten;
}
deleteuser ( uname)

error ausgabe datenbank datei nicht schreibbar

error ausgabe fehler beim schreiben der datenbank

Definiert in Zeile 114 der Datei index.php.

Benutzt $debugging, $FS, $out und $used.

                            {
        global $out;
        global $used;
        global $FS;
        global $debugging;
        $deleted = false;
        $fh = fopen($used["userlogindb"], 'r');
        $newdbfilecontent = "";
        if($fh == false) {
        $out["errors"] .= "ERROR: File not found -> ".$used["userlogindb"]."<br>";
        }else {
        while (!feof($fh)){
                   $line = fgets ($fh);
                   if ($line===FALSE) {
                        if ($debugging)  $out["errors"] .= " cant read line <br>"; 
                   } else {
                        $thefilepathtag = "|<username>".quotemeta($uname)."</username>|";
                         if (!preg_match($thefilepathtag,$line)) {  $newdbfilecontent .= $line; $deleted = true; } 
                   };
        }
        
    fclose($fh); 
        }
    if (!$fh = fopen($used["userlogindb"], 'w')) {
                /*! error ausgabe datenbank datei nicht schreibbar */
        $out["errors"] .= "Cannot open db file to write stuff  <br>";
    } else {
                if (fwrite($fh, $newdbfilecontent) === FALSE) {
                        /*! error ausgabe fehler beim schreiben der datenbank */
                        $out["errors"] .= "Cannot rewrite  db file <br>";
                }       
                fclose($fh);
        }
        return $deleted;
}
deleteuserformlist ( )

Definiert in Zeile 75 der Datei index.php.

Benutzt $debugging, $FS, $out und $used.

                              {
        global $out;
        global $used;
        global $FS;
        global $debugging;
        $outhtml ="";
        if (!$fh = fopen($used["userlogindb"], 'r')) {
                 $out["errors"] .= "Cannot open userlogin db file to read stuff  <br>";
        } else {                
                $theusernametag = "$<username>(.*)</username>$";
                                        $outhtml .= <<<HTMLUDEL
<form id="delluser" action="?" name="deluser"  method="post">
<input id="addnewusername" name="pathnow" value="$used[pathnow]" type="hidden" />
        <input id="addnewuserwhat" name="what" value="usermng" type="hidden" />
        <input id="addnewuseraction" name="action" value="deluser" type="hidden" />
THE SMUMD MASTER PASS : <input id="masterpass" name="masterpass" value="" type="password" size="30" /> <br />
HTMLUDEL;
                while (!feof($fh)){
                           $line = fgets ($fh);
                           if ($line===FALSE) {
                                if ($debugging)  $out["errors"] .= " cant read line <br>"; 
                           } else {
                                $uname = array();
                                 if (preg_match($theusernametag,$line,$uname)) {  
                                        $outhtml .= "<input id=\"deleteuseruname".$uname[1]."\" name=\"uname\" type=\"radio\" value=\"".$uname[1]."\" />".$uname[1]." | ";
                                 } 
                           };
                }       
                                        $outhtml .= <<<HTMLUDELETE
<input id="addnewuserabout" name="about" value="delete this user" type="submit" /> <br />
</form>
HTMLUDELETE;
                
                fclose($fh);
        }
        
        return $outhtml;
}

Variablen-Dokumentation

$doorder = ""

Definiert in Zeile 30 der Datei index.php.

$out["menu"]
Initialisierung:
"submit" /> <br />
</form>

ADMINMENU

Definiert in Zeile 58 der Datei index.php.

$used["pathnow"] = $SERVER_ROOT.$INSTALL_DIR. $FS .$SECURE_DIR

Definiert in Zeile 29 der Datei index.php.

$Version = "00004"

Definiert in Zeile 24 der Datei index.php.