summaryrefslogtreecommitdiffstats
path: root/ipsilon/login/authpam.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipsilon/login/authpam.py')
-rwxr-xr-xipsilon/login/authpam.py33
1 files changed, 3 insertions, 30 deletions
diff --git a/ipsilon/login/authpam.py b/ipsilon/login/authpam.py
index 663ed19..c88f0a0 100755
--- a/ipsilon/login/authpam.py
+++ b/ipsilon/login/authpam.py
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from ipsilon.login.common import LoginPageBase, LoginManagerBase
+from ipsilon.login.common import LoginFormBase, LoginManagerBase
from ipsilon.login.common import FACILITY
from ipsilon.util.plugin import PluginObject
import cherrypy
@@ -25,7 +25,7 @@ import pam
import subprocess
-class Pam(LoginPageBase):
+class Pam(LoginFormBase):
def _authenticate(self, username, password):
if self.lm.service_name:
@@ -40,11 +40,6 @@ class Pam(LoginPageBase):
cherrypy.log("User %s failed authentication." % username)
return None
- def GET(self, *args, **kwargs):
- context = self.create_tmpl_context()
- # pylint: disable=star-args
- return self._template('login/form.html', **context)
-
def POST(self, *args, **kwargs):
username = kwargs.get("login_name")
password = kwargs.get("login_password")
@@ -71,28 +66,6 @@ class Pam(LoginPageBase):
# pylint: disable=star-args
return self._template('login/form.html', **context)
- def root(self, *args, **kwargs):
- op = getattr(self, cherrypy.request.method, self.GET)
- if callable(op):
- return op(*args, **kwargs)
-
- def create_tmpl_context(self, **kwargs):
- next_url = None
- if self.lm.next_login is not None:
- next_url = self.lm.next_login.path
-
- context = {
- "title": 'Login',
- "action": '%s/login/pam' % self.basepath,
- "service_name": self.lm.service_name,
- "username_text": self.lm.username_text,
- "password_text": self.lm.password_text,
- "description": self.lm.help_text,
- "next_url": next_url,
- }
- context.update(kwargs)
- return context
-
class LoginManager(LoginManagerBase):
@@ -144,7 +117,7 @@ for authentication. """
return self.get_config_value('password text')
def get_tree(self, site):
- self.page = Pam(site, self)
+ self.page = Pam(site, self, 'login/pam')
return self.page