<?php include_once '../app/services/AuthenticationService.php'; include_once '../app/services/HttpService.php'; #Start session session_start(); // Check if post or get $method = $_SERVER['REQUEST_METHOD']; // POST - Save article if ($method == "POST") { $user = isset($_POST['username']) ? $_POST['username'] : null; $password = isset($_POST['password']) ? $_POST['password'] : null; AuthenticationService::login($user, $password); // Redirect to articles HttpService::redirect_to('/articles/'); } // GET - Show form if ($method == "GET") { $show_error = false; if (isset($_GET) && isset($_GET['login'])) { $show_error = true; } $page_title = "Login"; $page_content = '../app/views/login.php'; include_once '../app/views/_layout.php'; }
/** * test bad role * @expectedException Amfphp_Core_Exception */ public function testBadRole() { $this->serviceObj->login('user', 'userPassword'); $this->object->filterServiceObject($this->serviceObj, 'AnyService', 'adminMethod'); }
<?php include_once 'classDef.php'; include_once 'AuthenticationService.php'; $user = new authenticationType(); $user->username = '******'; $user->password = '******'; $user->client = 'tarifkalkulator'; $user->sessionId = session_id(); //$login = new AuthenticationService("./soap/wsdl/AuthenticationService.wsdl" , $options); $login = new AuthenticationService("https://ecws.e-control.at/tkws/services/AuthenticationService?wsdl", $options); //$login = new AuthenticationService(); $token = $login->login($user); // echo "TOKEN: " . $token->authenticationToken . "<br/>\n"; // echo "-------------------------------<br/>\n";