Browse Source

Added check to make sure it didn't add dir if already present

pull/24/head
Teknikode 8 years ago
parent
commit
679718d557
  1. 7
      includes/update_profile.php
  2. 5
      templates/default/js/profile.js

7
includes/update_profile.php

@ -150,7 +150,10 @@ if(isset($_POST)) @@ -150,7 +150,10 @@ if(isset($_POST))
}
}
mkdir($CONF['git_repo_path'][0].'gitolite-admin\\keydir\\u\\'.$user->username, 0777, true);
if (!is_dir($dir))
{
mkdir($dir, 0777, true);
}
$index = 0;
$keys = explode(",", $public_key);
foreach ($keys as $key)
@ -160,7 +163,7 @@ if(isset($_POST)) @@ -160,7 +163,7 @@ if(isset($_POST))
{
$key = "ssh-rsa " . $matches[2];
$keyFileName = $CONF['git_repo_path'][0].'gitolite-admin\\keydir\\u\\'.$user->username."\\".$user->username."@Key".$index.".pub";
$keyFileName = $dir."\\".$user->username."@Key".$index.".pub";
$fileHandle = fopen($keyFileName, 'w');
fwrite($fileHandle, $key);
fclose($fileHandle);

5
templates/default/js/profile.js

@ -65,7 +65,10 @@ $(document).ready(function() { @@ -65,7 +65,10 @@ $(document).ready(function() {
$("#update_submit").click(function(){
// Start Updating Animation
$.isLoading({ text: "Working" });
$.isLoading({
text: "Working",
position: "overlay"
});
current_password=encodeURIComponent($("#update_password_current").val());
password=encodeURIComponent($("#update_password").val());

Loading…
Cancel
Save