From b17cc67ee9cf6f83c2360da16fb53231203ada8a Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Wed, 23 May 2012 12:41:54 -0400
Subject: [PATCH] - Added group (we call groups "circles" so that users don't mix them up with user groups) feature to client messaging section so that messages can be sent to either all clients/resellers or to groups of clients/resellers. TODO: add circle access control so that 1) a reseller can create circles that contain only his clients, not all clients, and 2) a reseller can send messages only to his own circles instead of all circles.

---
 interface/web/tools/user_settings.php |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/interface/web/tools/user_settings.php b/interface/web/tools/user_settings.php
index eb52f58..70bbc69 100644
--- a/interface/web/tools/user_settings.php
+++ b/interface/web/tools/user_settings.php
@@ -64,6 +64,7 @@
 				
 				// Importing ID
                 $this->id = $_SESSION['s']['user']['userid'];
+				$_POST['id'] = $_SESSION['s']['user']['userid'];
 
                 if(count($_POST) > 1) {
                         $this->dataRecord = $_POST;
@@ -72,14 +73,21 @@
                         $this->onShow();
                 }
         }
+	
+	function onInsert() {
+		die('No inserts allowed.');
+	}
 		
 	function onBeforeUpdate() {
 		global $app, $conf;
 		
-		if($_POST['passwort'] != $_POST['passwort2']) {
-			$app->tform->errorMessage = 'The passwords in the second password field does not match the first password.';
-		}
+		if($conf['demo_mode'] == true && $this->id <= 3) $app->tform->errorMessage .= 'This function is disabled in demo mode.';
 		
+		if($_POST['passwort'] != $_POST['repeat_password']) {
+			$app->tform->errorMessage = $app->tform->lng('password_mismatch');
+		}
+		$_SESSION['s']['user']['language'] = $_POST['language'];
+		$_SESSION['s']['language'] = $_POST['language'];
 	}
 	
 	
@@ -88,4 +96,4 @@
 $page = new page_action;
 $page->onLoad();
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1