mirror of https://github.com/itflow-org/itflow
Fixed editing user profile
This commit is contained in:
parent
639661b2fe
commit
1ad28386f8
35
post.php
35
post.php
|
|
@ -102,6 +102,41 @@ if(isset($_POST['edit_user'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_POST['edit_profile'])){
|
||||
|
||||
$user_id = intval($_POST['user_id']);
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
||||
$current_password_hash = $_POST['current_password_hash'];
|
||||
$password = $_POST['password'];
|
||||
if($current_password_hash == $password){
|
||||
$password = $current_password_hash;
|
||||
}else{
|
||||
$password = md5($password);
|
||||
}
|
||||
$path = strip_tags(mysqli_real_escape_string($mysqli,$_POST['current_avatar_path']));
|
||||
|
||||
if($_FILES['file']['tmp_name']!='') {
|
||||
//delete old avatar file
|
||||
unlink($path);
|
||||
//Update with new path
|
||||
$path = "uploads/users/$user_id/";
|
||||
$path = $path . basename( $_FILES['file']['name']);
|
||||
$file_name = basename($path);
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], $path);
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"UPDATE users SET name = '$name', email = '$email', password = '$password', avatar = '$path', updated_at = NOW() WHERE user_id = $user_id");
|
||||
|
||||
//logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'User', log_action = 'Modified', log_description = '$name', log_created_at = NOW()");
|
||||
|
||||
$_SESSION['alert_message'] = "User <strong>$name</strong> updated";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['edit_user_companies'])){
|
||||
|
||||
$user_id = intval($_POST['user_id']);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ $password = $row['password'];
|
|||
<label>Avatar</label>
|
||||
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="file">
|
||||
</div>
|
||||
<button type="submit" name="edit_user" class="btn btn-primary mt-3"><i class="fa fa-fw fa-check"></i> Save</button>
|
||||
<button type="submit" name="edit_profile" class="btn btn-primary mt-3"><i class="fa fa-fw fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
|
||||
|
|
|
|||
10
setup.php
10
setup.php
|
|
@ -581,7 +581,7 @@ if(isset($_POST['add_company_settings'])){
|
|||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="add_company_settings" class="btn btn-primary">Finish and Login <i class="fa fa-fw fa-check-circle"></i></button>
|
||||
<button type="submit" name="add_company_settings" class="btn btn-primary">Finish and Sign in <i class="fa fa-fw fa-check-circle"></i></button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -594,18 +594,18 @@ if(isset($_POST['add_company_settings'])){
|
|||
<h3 class="card-title"><i class="fa fa-fw fa-cube"></i> Welcome to ITFlow Setup</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Click on the install button to start the install process, you must create a database before proceeding</p>
|
||||
<p>A database must be created before proceeding, then click on the Setup button to to get started, </p>
|
||||
<hr>
|
||||
<p>After install add cron.php to your cron and set it to run once everyday at 11:00PM. This is for tasks such as sending out recurring invoices, late payment reminders, alerts, etc</p>
|
||||
<p>After the setup is complete add cron.php to your cron and set it to run once everyday at 11:00PM. This is for tasks such as sending out recurring invoices, late payment reminders, alerts, etc</p>
|
||||
<hr>
|
||||
<p>An API is present to allow integration with other third pary apps. An API Key will be auto generated and can be changed in settings after install. The API will give you the following capabilities</p>
|
||||
<p>An API is present to allow integration with other third pary apps. An API Key will be auto generated and can be changed in settings after setup. The API will give you the following capabilities</p>
|
||||
<ul class="mb-4">
|
||||
<li>Address book XML for VOIP Phones</li>
|
||||
<li>Caller ID Lookup</li>
|
||||
<li>Get List of Emails in CSV to export to a mailing list</li>
|
||||
<li>Acquire balance can be useful for customer's to get their balance by phone</li>
|
||||
</ul>
|
||||
<center><a href="?database" class="btn btn-lg btn-primary">Install <i class="fa fa-fw fa-arrow-alt-circle-right"></i></a></center>
|
||||
<center><a href="?database" class="btn btn-primary">Setup <i class="fa fa-fw fa-arrow-alt-circle-right"></i></a></center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue