constructors are named __construct for php8
[plewww.git] / planetlab / includes / plc_session.php
index 1afbc7a..7850d86 100644 (file)
@@ -48,7 +48,7 @@ class PLCSession
   var $alt_person;
   var $alt_auth;
 
-  function PLCSession($name = NULL, $pass = NULL)
+  function __construct($name = NULL, $pass = NULL)
   {
     $name= strtolower( $name );
     // User API access
@@ -58,13 +58,14 @@ class PLCSession
                              'AuthString' => $pass));
 
       // Authenticate user and get session key
-      $session = $api->GetSession();
+      $seconds_to_expire = (24 * 60 * 60 * 14);
+      $session = $api->GetSession($seconds_to_expire);
       if (!$session) {
-       return NULL;
+          return NULL;
       }
 
       // Change GetSession() at some point to return expires as well
-      $expires = time() + (24 * 60 * 60);
+      $expires = time() + $seconds_to_expire;
 
       // Change to session authentication
       $api->auth = array('AuthMethod' => "session", 'session' => $session);