mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
clear session files
This commit is contained in:
@@ -42,7 +42,7 @@ if [[ ! -e /usr/local/CyberCP/bin/cleansessions ]]; then
|
|||||||
chmod +x /usr/local/CyberCP/bin/cleansessions
|
chmod +x /usr/local/CyberCP/bin/cleansessions
|
||||||
cat >> /usr/local/CyberCP/bin/cleansessions <<"EOL"
|
cat >> /usr/local/CyberCP/bin/cleansessions <<"EOL"
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
for version in $(ls /usr/local/lsws|grep lsphp); do echo ""; echo "PHP $version"; session_time=$(/usr/local/lsws/${version}/bin/php -i |grep -Ei 'session.gc_maxlifetime'| grep -Eo "[[:digit:]]+"|sort -u); find -O3 "/var/lib/lsphp/session/${version}" -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin "${session_time}" -delete; done
|
for version in $(ls /usr/local/lsws|grep lsphp); do echo ""; echo "PHP $version"; session_time=$(/usr/local/lsws/${version}/bin/php -i |grep -Ei 'session.gc_maxlifetime'| grep -Eo "[[:digit:]]+"|sort -u); find -O3 "/var/lib/lsphp/session/${version}" -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin 120 -delete; done
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class secMiddleware:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
if hasattr(value, "__len__"):
|
if type(value) == list:
|
||||||
for items in value:
|
for items in value:
|
||||||
if items.find('- -') > -1 or items.find('\n') > -1 or items.find(';') > -1 or items.find(
|
if items.find('- -') > -1 or items.find('\n') > -1 or items.find(';') > -1 or items.find(
|
||||||
'&&') > -1 or items.find('|') > -1 or items.find('...') > -1 \
|
'&&') > -1 or items.find('|') > -1 or items.find('...') > -1 \
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
config= {
|
hey = ['hey', 'aaa', 'aaa', 'adssad']
|
||||||
"name": "habi",
|
aaa='aaa'
|
||||||
"dev": "python"
|
print(type(hey))
|
||||||
}
|
print(type(aaa))
|
||||||
|
print(hasattr(hey, "__len__"))
|
||||||
|
print(hasattr(aaa, "__len__"))
|
||||||
|
|
||||||
print(config)
|
if type(hey) == list:
|
||||||
config['klm'] ="tls"
|
print('list')
|
||||||
|
else:
|
||||||
|
print('hey not list')
|
||||||
|
|
||||||
print(config)
|
if type(aaa) == list:
|
||||||
|
print('aaa')
|
||||||
|
else:
|
||||||
|
print('aaa not list')
|
||||||
Reference in New Issue
Block a user