Location: PHPKode > projects > DebWeb GUI > debwgui/test.php
<?php
// crypt testing
if(!empty($_POST['salt'])) {

function securepassword($clearpass,$salt) {
  $cryptedsalt = md5($salt);
  $cryptedpass = md5($clearpass);
  $joinedpass  = "$cryptedsalt$cryptedpass";
  $securedpass = md5($joinedpass);
  return $securedpass;
}
print "config.php login info:<br>";
print "\$settings['PASSWORD'] = '".securepassword($_POST['clearpass'],$_POST['salt'])."';<br>";
print "\$settings['PWDSALT']  = '".$_POST['salt']."';<br>";
}

print phpversion();
print "<br>";
echo substr(sprintf('%o', fileperms('/tmp')), -3);

?> 
</form>

<form name="createpass" method="post" action="">

  <input type="password" name="clearpass">
  : password 
  <br>

  <input type="text" name="salt">
: crypt salt (minimum 8 characters) <br>
  <input type="submit" name="encrypt" value="Create password">
<br>
</form>


<table>
<!--
<?php 
$loadcontent = "httpd.conf";
   if($save_file) {
       $savecontent = stripslashes($savecontent);
       $fp = @fopen($loadcontent, "w");
       if ($fp) {
           fwrite($fp, $savecontent);
           fclose($fp);
}
}
   $fp = @fopen($loadcontent, "r");
       $loadcontent = fread($fp, filesize($loadcontent));
       fclose($fp);

if (extension_loaded('gd')) {
       print "gd er installert";
   }

 
?>
<form method=post action="<?=$_SERVER[PHP_SELF]?>">
<textarea name="savecontent" cols="100" rows="35"><?=$loadcontent?></textarea>
<br>
<input type="submit" name="save_file" value="Lagre">
</form><br>

<a href="/">Tilbake</a>

-->
Return current item: DebWeb GUI