diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-10 23:07:52 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-10 23:07:52 +0200 |
commit | fc4e71d7809e6e9975d678ee388fc28c74e0e3af (patch) | |
tree | ce9624f00ed5a8ab22781476ea1b8196bee53527 /pyload/web/utils.py | |
parent | new hoster links, fixed manifest (diff) | |
download | pyload-fc4e71d7809e6e9975d678ee388fc28c74e0e3af.tar.xz |
several ui fixes
Diffstat (limited to 'pyload/web/utils.py')
-rw-r--r-- | pyload/web/utils.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/pyload/web/utils.py b/pyload/web/utils.py index b5a933b26..dae987f84 100644 --- a/pyload/web/utils.py +++ b/pyload/web/utils.py @@ -13,6 +13,7 @@ def set_session(request, user): s.save() return s + def get_user_api(s): if s: uid = s.get("uid", None) @@ -20,6 +21,7 @@ def get_user_api(s): return PYLOAD.withUserContext(uid) return None + def is_mobile(): if request.get_cookie("mobile"): if request.get_cookie("mobile") == "True": @@ -36,12 +38,17 @@ def is_mobile(): if re.search('(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)', mobile_ua) is not None: return True mobile_ua = mobile_ua[:4] - mobile_agents = ['w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac','blaz','brew','cell','cldc','cmd-', - 'dang','doco','eric','hipt','inno','ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-', - 'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-','newt','noki','palm','pana','pant', - 'phil','play','port','prox','qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar','sie-', - 'siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-','tosh','tsm-','upg1','upsi','vk-v','voda', - 'wap-','wapa','wapi','wapp','wapr','webc','winw','winw','xda ','xda-'] + mobile_agents = ['w3c ', 'acs-', 'alav', 'alca', 'amoi', 'audi', 'avan', 'benq', 'bird', 'blac', 'blaz', 'brew', + 'cell', 'cldc', 'cmd-', + 'dang', 'doco', 'eric', 'hipt', 'inno', 'ipaq', 'java', 'jigs', 'kddi', 'keji', 'leno', 'lg-c', + 'lg-d', 'lg-g', 'lge-', + 'maui', 'maxo', 'midp', 'mits', 'mmef', 'mobi', 'mot-', 'moto', 'mwbp', 'nec-', 'newt', 'noki', + 'palm', 'pana', 'pant', + 'phil', 'play', 'port', 'prox', 'qwap', 'sage', 'sams', 'sany', 'sch-', 'sec-', 'send', 'seri', + 'sgh-', 'shar', 'sie-', + 'siem', 'smal', 'smar', 'sony', 'sph-', 'symb', 't-mo', 'teli', 'tim-', 'tosh', 'tsm-', 'upg1', + 'upsi', 'vk-v', 'voda', + 'wap-', 'wapa', 'wapi', 'wapp', 'wapr', 'webc', 'winw', 'winw', 'xda ', 'xda-'] if mobile_ua in mobile_agents: return True return False |