Hanno Böck
Fix some typos
Hanno Böck commited a49d0dd at 2024-04-23 20:57:41
useraccounts.php
<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
This code is published under a 0BSD license.
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
*/
require_once("inc/debug.php");
function customer_may_have_useraccounts()
{
$customerno = (int) $_SESSION['customerinfo']['customerno'];
$result = db_query("SELECT COUNT(*) FROM system.useraccounts WHERE kunde=?", [$customerno]);
return ($result->rowCount() > 0);
}
function customer_useraccount($uid)
{
$args = [":uid" => $uid, ":customerno" => $_SESSION['customerinfo']['customerno']];
$result = db_query("SELECT 1 FROM system.useraccounts WHERE kunde=:customerno AND uid=:uid AND kundenaccount=1", $args);
return $result->rowCount() > 0;
}
function primary_useraccount()
{
if (!($_SESSION['role'] & ROLE_SYSTEMUSER)) {
return null;
}
$customerno = (int) $_SESSION['customerinfo']['customerno'];
$result = db_query("SELECT MIN(uid) AS uid FROM system.useraccounts WHERE kunde=?", [$customerno]);
$uid = $result->fetch(PDO::FETCH_OBJ)->uid;
DEBUG("primary useraccount: {$uid}");
return $uid;
}
function available_shells()
{
$result = db_query("SELECT path, name FROM system.shells WHERE usable=?", [1]);
$ret = [];
while ($s = $result->fetch()) {
$ret[$s['path']] = $s['name'];
}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX