@@ -113,20 +113,20 @@ public function client_get_id($session_id, $sys_userid)
113113 }
114114
115115 }
116-
116+
117117 //* Get the contact details to send a email like email address, name, etc.
118118 public function client_get_emailcontact ($ session_id , $ client_id ) {
119119 global $ app ;
120-
120+
121121 if (!$ this ->checkPerm ($ session_id , 'client_get_emailcontact ' )) {
122122 throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
123123 return false ;
124124 }
125-
125+
126126 $ client_id = $ app ->functions ->intval ($ client_id );
127127
128128 $ rec = $ app ->db ->queryOneRecord ("SELECT company_name,contact_name,gender,email,language FROM client WHERE client_id = ? " , $ client_id );
129-
129+
130130 if (is_array ($ rec )) {
131131 return $ rec ;
132132 } else {
@@ -159,7 +159,7 @@ public function client_get_groupid($session_id, $client_id)
159159 public function client_add ($ session_id , $ reseller_id , $ params )
160160 {
161161 global $ app ;
162-
162+
163163 if (!$ this ->checkPerm ($ session_id , 'client_add ' ))
164164 {
165165 throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
@@ -198,7 +198,7 @@ public function client_update($session_id, $client_id, $reseller_id, $params)
198198 $ app ->uses ('remoting_lib ' );
199199 $ app ->remoting_lib ->loadFormDef ('../client/form/ ' . (isset ($ params ['limit_client ' ]) && $ params ['limit_client ' ] != 0 ? 'reseller ' : 'client ' ) . '.tform.php ' );
200200 $ old_rec = $ app ->remoting_lib ->getDataRecord ($ client_id );
201-
201+
202202 //* merge old record with params, so only new values have to be set in $params
203203 $ params = $ app ->functions ->array_merge ($ old_rec ,$ params );
204204
@@ -218,7 +218,7 @@ public function client_update($session_id, $client_id, $reseller_id, $params)
218218 }
219219 }
220220
221- // we need the previuos templates assigned here
221+ // we need the previous templates assigned here
222222 $ this ->oldTemplatesAssigned = $ app ->db ->queryAllRecords ('SELECT * FROM `client_template_assigned` WHERE `client_id` = ? ' , $ client_id );
223223 if (!is_array ($ this ->oldTemplatesAssigned ) || count ($ this ->oldTemplatesAssigned ) < 1 ) {
224224 // check previous type of storing templates
@@ -243,7 +243,7 @@ public function client_update($session_id, $client_id, $reseller_id, $params)
243243 $ affected_rows = $ this ->updateQuery ('../client/form/ ' . (isset ($ params ['limit_client ' ]) && $ params ['limit_client ' ] != 0 ? 'reseller ' : 'client ' ) . '.tform.php ' , $ reseller_id , $ client_id , $ params , 'client: ' . ($ reseller_id ? 'reseller ' : 'client ' ) . ':on_after_update ' );
244244
245245 $ app ->remoting_lib ->ispconfig_sysuser_update ($ params , $ client_id );
246-
246+
247247 // if canceled
248248 if ($ params ['canceled ' ]) {
249249 $ result = $ app ->functions ->func_client_cancel ($ client_id , $ params ['canceled ' ]);
@@ -482,7 +482,7 @@ public function client_get_by_username($session_id, $username) {
482482 return false ;
483483 }
484484 }
485-
485+
486486 public function client_get_by_customer_no ($ session_id , $ customer_no ) {
487487 global $ app ;
488488 if (!$ this ->checkPerm ($ session_id , 'client_get_by_customer_no ' )) {
@@ -573,16 +573,16 @@ public function client_templates_get_all($session_id) {
573573 $ result = $ app ->db ->queryAllRecords ($ sql );
574574 return $ result ;
575575 }
576-
576+
577577 public function client_login_get ($ session_id ,$ username ,$ password ,$ remote_ip = '' ) {
578578 global $ app ;
579-
579+
580580 //* Check permissions
581581 if (!$ this ->checkPerm ($ session_id , 'client_get ' )) {
582582 throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
583583 return false ;
584584 }
585-
585+
586586 //* Check username and password
587587 if (!preg_match ("/^[\w\.\-\_\@]{1,128}$/ " , $ username )) {
588588 throw new SoapFault ('user_regex_error ' , 'Username contains invalid characters. ' );
@@ -592,21 +592,21 @@ public function client_login_get($session_id,$username,$password,$remote_ip = ''
592592 throw new SoapFault ('password_length_error ' , 'Invalid password length or no password provided. ' );
593593 return false ;
594594 }
595-
595+
596596 //* Check failed logins
597597 $ sql = "SELECT * FROM `attempts_login` WHERE `ip`= ? AND `login_time` > (NOW() - INTERVAL 1 MINUTE) LIMIT 1 " ;
598598 $ alreadyfailed = $ app ->db ->queryOneRecord ($ sql , $ remote_ip );
599-
599+
600600 //* too many failedlogins
601601 if ($ alreadyfailed ['times ' ] > 5 ) {
602602 throw new SoapFault ('error_user_too_many_logins ' , 'Too many failed logins. ' );
603603 return false ;
604604 }
605-
606-
605+
606+
607607 //*Set variables
608608 $ returnval == false ;
609-
609+
610610 if (strstr ($ username ,'@ ' )) {
611611 // Check against client table
612612 $ sql = "SELECT * FROM client WHERE email = ? " ;
@@ -628,15 +628,15 @@ public function client_login_get($session_id,$username,$password,$remote_ip = ''
628628 }
629629 }
630630 }
631-
631+
632632 if (is_array ($ user )) {
633633 $ returnval = array ( 'username ' => $ user ['username ' ],
634634 'type ' => 'user ' ,
635635 'client_id ' => $ user ['client_id ' ],
636636 'language ' => $ user ['language ' ],
637637 'country ' => $ user ['country ' ]);
638638 }
639-
639+
640640 } else {
641641 // Check against sys_user table
642642 $ sql = "SELECT * FROM sys_user WHERE username = ? " ;
@@ -658,7 +658,7 @@ public function client_login_get($session_id,$username,$password,$remote_ip = ''
658658 }
659659 }
660660 }
661-
661+
662662 if (is_array ($ user )) {
663663 $ returnval = array ( 'username ' => $ user ['username ' ],
664664 'type ' => $ user ['typ ' ],
@@ -669,7 +669,7 @@ public function client_login_get($session_id,$username,$password,$remote_ip = ''
669669 throw new SoapFault ('login_failed ' , 'Login failed. ' );
670670 }
671671 }
672-
672+
673673 //* Log failed login attempts
674674 if ($ user === false ) {
675675 if (!$ alreadyfailed ['times ' ] ) {
@@ -682,10 +682,10 @@ public function client_login_get($session_id,$username,$password,$remote_ip = ''
682682 $ app ->db ->query ($ sql , $ remote_ip );
683683 }
684684 }
685-
685+
686686 return $ returnval ;
687687 }
688-
688+
689689 public function client_get_by_groupid ($ session_id , $ group_id )
690690 {
691691 global $ app ;
0 commit comments