From 46ea1abc880fc9b84e7092307e3633a4f5887413 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Wed, 02 Mar 2016 05:17:04 -0500
Subject: [PATCH] - re-factored coding guidelines
---
interface/web/client/client_edit.php | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/interface/web/client/client_edit.php b/interface/web/client/client_edit.php
index bbeb822..219fdfa 100644
--- a/interface/web/client/client_edit.php
+++ b/interface/web/client/client_edit.php
@@ -129,7 +129,7 @@
global $app;
- $sql = "SELECT template_id,template_name FROM client_template WHERE template_type = 'a' ORDER BY template_name ASC";
+ $sql = "SELECT template_id,template_name FROM client_template WHERE template_type = 'a' and ".$app->tform->getAuthSQL('r')." ORDER BY template_name ASC";
$tpls = $app->db->queryAllRecords($sql);
$option = '';
$tpl = array();
@@ -249,7 +249,7 @@
$modules = $conf['interface_modules_enabled'];
if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] > 0) $modules .= ',client';
$startmodule = (stristr($modules, 'dashboard'))?'dashboard':'client';
- $usertheme = $this->dataRecord["usertheme"];
+ $usertheme = (isset($this->dataRecord["usertheme"]) && $this->dataRecord["usertheme"] != ''? $this->dataRecord["usertheme"] : 'default');
$type = 'user';
$active = 1;
$language = $this->dataRecord["language"];
@@ -408,13 +408,7 @@
// password changed
if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') {
$password = $this->dataRecord["password"];
- $salt="$1$";
- $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
- for ($n=0;$n<8;$n++) {
- $salt.=$base64_alphabet[mt_rand(0, 63)];
- }
- $salt.="$";
- $password = crypt(stripslashes($password), $salt);
+ $password = $app->auth->crypt_password($password);
$client_id = $this->id;
$sql = "UPDATE sys_user SET passwort = ? WHERE client_id = ?";
$app->db->query($sql, $password, $client_id);
--
Gitblit v1.9.1