Remove requirement for username to be provided on login page

Change login parameter descriptions on Config / General
This commit is contained in:
Adam 2015-03-01 11:01:43 +08:00
parent b3b84ecade
commit 7413b38640
3 changed files with 4 additions and 7 deletions

View file

@ -333,7 +333,7 @@
<span class="component-title">Username</span>
<span class="component-desc">
<input type="text" name="web_username" id="web_username" value="$sickbeard.WEB_USERNAME" class="form-control input-sm input300">
<p>blank = disable SickGear login</p>
<p>blank for none</p>
</span>
</label>
</div>
@ -343,7 +343,7 @@
<span class="component-title">Password</span>
<span class="component-desc">
<input type="password" name="web_password" id="web_password" value="$sickbeard.WEB_PASSWORD" class="form-control input-sm input300">
<p>blank = no authentication</p>
<p>blank for none</p>
<span class="clear-left">check autoProcessTV.cfg is set up for external apps to use post processing scripts
</label>
</div>

View file

@ -46,7 +46,7 @@
</head>
<body><div class="login"><form action="" method="post"><div class="login-img center-block form-group"></div>
<div class="login-error"><div class="#if 'authfailed'==$resp then 'showme' else 'hide' #"><i class="error16"></i><span class="red-text">Authentication failed, please retry</span></div></div>
<div class="form-group input-group"><span class="input-group-addon"><i class="icons icons-user" style=""></i></span><input name="username" class="form-control" placeholder="Username" type="text" autofocus required></div>
<div class="form-group input-group"><span class="input-group-addon"><i class="icons icons-user" style=""></i></span><input name="username" class="form-control" placeholder="Username" type="text" autofocus></div>
<div class="form-group input-group"><span class="input-group-addon"><i class="icons icons-lock" style=""></i></span><input name="password" class="form-control" placeholder="Password" type="password"></div>
<div class="form-group"><label for="remember_me" class="login-remember"><input id="remember_me" name="remember_me" type="checkbox" value="1" checked="checked"><span>Remember me</span></label><input class="btn pull-right" name="submit" type="submit" value="Login"></div>
</form></div></body></html>

View file

@ -175,12 +175,9 @@ class LoginHandler(BaseHandler):
username = sickbeard.WEB_USERNAME
password = sickbeard.WEB_PASSWORD
if (self.get_argument('username') == username or not username) \
and (self.get_argument('password') == password or not password):
if (self.get_argument('username') == username) and (self.get_argument('password') == password):
remember_me = int(self.get_argument('remember_me', default=0) or 0)
self.set_secure_cookie('sickgear-session', sickbeard.COOKIE_SECRET, expires_days=30 if remember_me > 0 else None)
self.redirect(self.get_argument('next', '/home/'))
else:
next_arg = '&next=' + self.get_argument('next', '/home/')