cvs: php4 /pear/PEAR/Command Auth.php

From: Date: Sun, 31 Mar 2002 01:51:08 +0000
Subject: cvs: php4 /pear/PEAR/Command Auth.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-2922@lists.php.net to get a copy of this message
ssb Sat Mar 30 20:51:08 2002 EDT Modified files: /php4/pear/PEAR/Command Auth.php Log: * avoid object copying Index: php4/pear/PEAR/Command/Auth.php diff -u php4/pear/PEAR/Command/Auth.php:1.2 php4/pear/PEAR/Command/Auth.php:1.3 --- php4/pear/PEAR/Command/Auth.php:1.2 Fri Mar 22 06:09:58 2002 +++ php4/pear/PEAR/Command/Auth.php Sat Mar 30 20:51:08 2002 @@ -16,7 +16,7 @@ // | Author: Stig Bakken <ssb@fast.no> | // +----------------------------------------------------------------------+ // -// $Id: Auth.php,v 1.2 2002/03/22 11:09:58 ssb Exp $ +// $Id: Auth.php,v 1.3 2002/03/31 01:51:08 ssb Exp $ require_once "PEAR/Command/Common.php"; require_once "PEAR/Remote.php"; @@ -73,28 +73,27 @@ */ function run($command, $options, $params) { - $cf = $this->config; $failmsg = ''; - $server = $cf->get('master_server'); + $server = $this->config->get('master_server'); switch ($command) { case 'login': { - $remote = new PEAR_Remote($cf); - $username = $cf->get('username'); + $remote = new PEAR_Remote($this->config); + $username = $this->config->get('username'); if (empty($username)) { $username = @$_ENV['USER']; } $this->ui->displayLine("Logging in to $server."); $username = trim($this->ui->userDialog('Username', 'text', $username)); - $cf->set('username', $username); + $this->config->set('username', $username); $password = trim($this->ui->userDialog('Password', 'password')); - $cf->set('password', $password); + $this->config->set('password', $password); $remote->expectError(401); $ok = $remote->call('logintest'); $remote->popExpect(); if ($ok === true) { $this->ui->displayLine("Logged in."); - $cf->store(); + $this->config->store(); } else { $this->ui->displayLine("Login failed!"); } @@ -102,9 +101,9 @@ } case 'logout': { $this->ui->displayLine("Logging out from $server."); - $cf->remove('username'); - $cf->remove('password'); - $cf->store(); + $this->config->remove('username'); + $this->config->remove('password'); + $this->config->store(); break; } default: {

« previous php.pear.cvs (#2922) next »