Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pablo Rauzy
cigala
Commits
e9c04299
Commit
e9c04299
authored
Nov 18, 2020
by
Pablo Rauzy
Browse files
fix never logged in bug
parent
06649c58
Changes
1
Hide whitespace changes
Inline
Side-by-side
root/manage.php
View file @
e9c04299
...
...
@@ -69,15 +69,19 @@ while ($usr = $res->fetchArray(SQLITE3_ASSOC)) {
list
(
$name
,
$domain
,
$tld
)
=
explode
(
'.'
,
$usr
[
'name'
],
3
);
$home
=
str_replace
(
'%DOMAIN%'
,
$domain
,
$config
[
'home'
])
.
$name
;
}
else
{
$home
=
$config
[
'home'
]
.
$usr
[
'name'
];
else
{
$home
=
$config
[
'home'
]
.
$usr
[
'name'
];
}
try
{
$udb
=
new
SQLite3
(
$home
.
'.db'
,
SQLITE3_OPEN_READONLY
);
$usr
[
'quota'
]
=
$udb
->
querySingle
(
"select value from settings where key='diskquota'"
);
$udb
->
close
();
$usr
[
'usage'
]
=
dirsize
(
$home
);
$usr
[
'usage'
]
+=
filesize
(
$home
.
'.db'
);
$usr
[
'usage'
]
+=
@
filesize
(
$home
.
'.zip'
);
}
catch
(
Exception
$e
)
{
$usr
[
'quota'
]
=
-
1
;
$usr
[
'usage'
]
=
0
;
}
$udb
=
new
SQLite3
(
$home
.
'.db'
);
$usr
[
'quota'
]
=
$udb
->
querySingle
(
"select value from settings where key='diskquota'"
);
$udb
->
close
();
$usr
[
'usage'
]
=
dirsize
(
$home
);
$usr
[
'usage'
]
+=
filesize
(
$home
.
'.db'
);
$usr
[
'usage'
]
+=
@
filesize
(
$home
.
'.zip'
);
$users
[]
=
$usr
;
}
$db
->
close
();
...
...
@@ -126,7 +130,11 @@ $db->close();
<span><a
href=
"https://
<?php
echo
$u
[
'name'
];
?>
.cygale.net/"
>
<?php
echo
$u
[
'name'
];
?>
</a></span>
<?php
endif
;
?>
<span>
<span
style=
"display:inline-block; position:relative; width:200px; background-color:#aaa; z-index:5; text-align:center;"
><span
style=
"display:inline-block; position:absolute; left:0; top:0; z-index:6; width:
<?php
echo
round
((
$u
[
'usage'
]
/
$u
[
'quota'
])
*
200
);
?>
px; background-color: #08f; "
>
</span><span
style=
"position:relative; z-index:7; color:#fff;"
>
<?php
echo
round
(
$u
[
'usage'
]
/
1024
,
2
);
?>
KB /
<?php
echo
(
$u
[
'quota'
]
/
(
1024
*
1024
));
?>
MB
</span></span>
<?php
if
(
$u
[
'quota'
]
<
0
)
:
?>
never logged in
<?php
else
:
?>
<span
style=
"display:inline-block; position:relative; width:200px; background-color:#aaa; z-index:5; text-align:center;"
><span
style=
"display:inline-block; position:absolute; left:0; top:0; z-index:6; width:
<?php
echo
round
((
$u
[
'usage'
]
/
$u
[
'quota'
])
*
200
);
?>
px; background-color:#08f;"
>
</span><span
style=
"position:relative; z-index:7; color:#fff;"
>
<?php
echo
round
(
$u
[
'usage'
]
/
1024
,
2
);
?>
KB /
<?php
echo
(
$u
[
'quota'
]
/
(
1024
*
1024
));
?>
MB
</span></span>
<?php
endif
;
?>
</span>
<span>
<button
type=
"submit"
name=
"quota"
value=
"
<?php
echo
$u
[
'name'
];
?>
"
>
Update quota
</button>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment