clear session files

This commit is contained in:
Usman Nasir
2022-08-20 15:56:50 +05:00
parent 17821ad6ea
commit 7818675685
3 changed files with 16 additions and 9 deletions

View File

@@ -42,7 +42,7 @@ if [[ ! -e /usr/local/CyberCP/bin/cleansessions ]]; then
chmod +x /usr/local/CyberCP/bin/cleansessions
cat >> /usr/local/CyberCP/bin/cleansessions <<"EOL"
#!/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
fi

View File

@@ -71,7 +71,7 @@ class secMiddleware:
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
if hasattr(value, "__len__"):
if type(value) == list:
for items in value:
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 \

View File

@@ -1,9 +1,16 @@
config= {
"name": "habi",
"dev": "python"
}
hey = ['hey', 'aaa', 'aaa', 'adssad']
aaa='aaa'
print(type(hey))
print(type(aaa))
print(hasattr(hey, "__len__"))
print(hasattr(aaa, "__len__"))
print(config)
config['klm'] ="tls"
if type(hey) == list:
print('list')
else:
print('hey not list')
print(config)
if type(aaa) == list:
print('aaa')
else:
print('aaa not list')