logo       
Google Custom Search
    AddThis Social Bookmark Button

cvs: pear-core /PEAR/Command Auth.php: msg#00274

Subject: cvs: pear-core /PEAR/Command Auth.php
cellog          Mon Dec 27 01:33:21 2004 EDT

  Modified files:              
    /pear-core/PEAR/Command     Auth.php 
  Log:
  fix up login/logout to work with new setup
  
http://cvs.php.net/diff.php/pear-core/PEAR/Command/Auth.php?r1=1.15&r2=1.16&ty=u
Index: pear-core/PEAR/Command/Auth.php
diff -u pear-core/PEAR/Command/Auth.php:1.15 
pear-core/PEAR/Command/Auth.php:1.16
--- pear-core/PEAR/Command/Auth.php:1.15        Thu Jan  8 12:33:13 2004
+++ pear-core/PEAR/Command/Auth.php     Mon Dec 27 01:33:20 2004
@@ -16,7 +16,7 @@
 // | Author: Stig Bakken <ssb@xxxxxxx>                                    |
 // +----------------------------------------------------------------------+
 //
-// $Id: Auth.php,v 1.15 2004/01/08 17:33:13 sniper Exp $
+// $Id: Auth.php,v 1.16 2004/12/27 06:33:20 cellog Exp $
 
 require_once "PEAR/Command/Common.php";
 require_once "PEAR/Remote.php";
@@ -91,8 +91,11 @@
      */
     function doLogin($command, $options, $params)
     {
-        $server = $this->config->get('master_server');
-        $remote = new PEAR_Remote($this->config);
+        $reg = &$this->config->getRegistry();
+        $channel = $this->config->get('default_channel');
+        $chan = $reg->getChannel($channel);
+        $server = $this->config->get('preferred_mirror');
+        $remote = &$this->config->getRemote();
         $username = $this->config->get('username');
         if (empty($username)) {
             $username = @$_ENV['USER'];
@@ -110,10 +113,14 @@
         
         $this->config->set('username', $username);
         $this->config->set('password', $password);
-        
-        $remote->expectError(401);
-        $ok = $remote->call('logintest');
-        $remote->popExpect();
+
+        if ($chan->supportsREST()) {
+            $ok = true;
+        } else {
+            $remote->expectError(401);
+            $ok = $remote->call('logintest');
+            $remote->popExpect();
+        }
         if ($ok === true) {
             $this->ui->outputData("Logged in.", $command);
             $this->config->store();
@@ -142,7 +149,10 @@
      */
     function doLogout($command, $options, $params)
     {
-        $server = $this->config->get('master_server');
+        $reg = &$this->config->getRegistry();
+        $channel = $this->config->get('default_channel');
+        $chan = $reg->getChannel($channel);
+        $server = $this->config->get('preferred_mirror');
         $this->ui->outputData("Logging out from $server.", $command);
         $this->config->remove('username');
         $this->config->remove('password');

-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>