8c86a8ce3d9880a64d46f936f60b5b7232a77a38
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

1) <?php
2) 
3) require_once("inc/debug.php");
4) require_once("inc/db_connect.php");
5) 
6) require_role(ROLE_CUSTOMER);
7) 
8) 
9) function customer_may_have_useraccounts()
10) {
11)   $customerno = (int) $_SESSION['customerinfo']['customerno'];
12)   $result = db_query("SELECT COUNT(*) FROM system.useraccounts WHERE kunde={$customerno}");
13)   return (mysql_num_rows($result) > 0);
14) }
15) 
16) 
bernd Primärer Useraccount kann d...

bernd authored 16 years ago

17) function primary_useraccount()
18) {
19)   if (! ($_SESSION['role'] & ROLE_SYSTEMUSER))
20)     return NULL;
21)   $customerno = (int) $_SESSION['customerinfo']['customerno'];
22)   $result = db_query("SELECT MIN(uid) AS uid FROM system.useraccounts WHERE kunde={$customerno}");
23)   $uid = mysql_fetch_object($result)->uid;
24)   DEBUG("primary useraccount: {$uid}");
25)   return $uid;
26) }
27) 
28)