Start adding basic login infrastructure (still needs styling)
[gitphp.git] / include / router / Router.class.php
blob:a/include/router/Router.class.php -> blob:b/include/router/Router.class.php
--- a/include/router/Router.class.php
+++ b/include/router/Router.class.php
@@ -214,7 +214,7 @@
 
 		// non-project action
 		$this->routes[] = new GitPHP_Route(':action', array(
-			'action' => 'opml|projectindex'
+			'action' => 'opml|projectindex|login|logout'
 		));
 
 		usort($this->routes, array('GitPHP_Route', 'CompareRoute'));
@@ -479,6 +479,19 @@
 				$controller->SetParam('opml', true);
 				break;
 
+			
+			case 'login':
+				$controller = new GitPHP_Controller_Login();
+				if (!empty($_POST['username']))
+					$controller->SetParam('username', $_POST['username']);
+				if (!empty($_POST['password']))
+					$controller->SetParam('password', $_POST['password']);
+				break;
+
+			case 'logout':
+				$controller = new GitPHP_Controller_Logout();
+				break;
+
 
 			case 'graph':
 			case 'graphs':

comments