add email field into users

This commit is contained in:
rsgrinko committed 2021-12-06 22:41:44 +03:00
1 parent c8b83035e7
commit 84761dd929
4 files changed
+27 -3

No files matched your search

+22
View File
@@ -294,3 +294,25 @@ function prepareArrFiles($arrFiles, $name) {
return $arrFiles;
}
/**
* Преобразует байты в человекопонятный вид
*
* @param $bytes
* @return string
*/
function bytesToString($bytes) {
if ($bytes < 1000 * 1024) {
return number_format($bytes / 1024, 2) . ' KB';
}
elseif ($bytes < 1000 * 1048576) {
return number_format( $bytes / 1048576, 2) . ' MB';
}
elseif ($bytes < 1000 * 1073741824) {
return number_format($bytes / 1073741824, 2) . ' GB';
}
else {
return number_format($bytes / 1099511627776, 2) . ' TB';
}
}
+1 -1
View File
@@ -179,7 +179,7 @@ class CCron
{
if (!isset($id) or empty($id)) return false;
$res = self::$DB->remove(self::$table, array('id' => $id));
CEvents::add('Задание с ID: ' . $id . '. было удалено', 'info', 'cron');
CEvents::add('Задание с ID: ' . $id . ' было удалено', 'info', 'cron');
return true;
}
+2 -2
View File
@@ -102,8 +102,8 @@ class CUser {
* @param string $name
* @param string $image
*/
public static function Registration($login, $password, $level = 'user', $name = '', $image = ''):void {
self::$DB->addItem(self::$table, array('login' => $login, 'password' => $password, 'access_level' => $level, 'name' => $name,'image' => $image, 'last_active' => time()));
public static function Registration($login, $password, $email, $level = 'user', $name = '', $image = ''):void {
self::$DB->addItem(self::$table, array('login' => $login, 'password' => $password, 'access_level' => $level, 'name' => $name,'image' => $image, 'email' => $email, 'last_active' => time()));
$result = self::$DB->getItem(self::$table, array('login'=>$login, 'password' => $password));
self::$id = $result['id'];
+2
View File
@@ -25,6 +25,7 @@
<th class="text-center" style="width: 50px;">ID</th>
<th>Логин</th>
<th>Имя</th>
<th>E-Mail</th>
<th>Доступ</th>
<th>Изображение</th>
<th>Последняя активность</th>
@@ -41,6 +42,7 @@
<td class="text-center"><?php echo $user['id']; ?></td>
<td><?php echo $user['login']; ?></td>
<td><?php echo $user['name']; ?></td>
<td><a href="mailto:<?php echo $user['email']; ?>"><?php echo $user['email']; ?></a></td>
<td><?php echo $user['access_level']; ?></td>
<td style="text-align:center;"><a href="<?php echo $user['image']; ?>" target="_blank"><img style="max-width: 40px;" src="<?php echo $user['image']; ?>" alt="avatar"></a></td>
<td><?php echo date("d.m.Y H:i:s", $user['last_active']); ?></td>