svn: /web/doc-editor/trunk/php/ class.php

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Wed, 11 Nov 2009 21:07:52 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=290531

Log:
Remove login's method from class.php. This method is present in AccountManager.php as login's method

Changed paths:
    U   web/doc-editor/trunk/php/class.php

Modified: web/doc-editor/trunk/php/class.php
===================================================================
--- web/doc-editor/trunk/php/class.php	2009-11-11 21:07:06 UTC (rev 290530)
+++ web/doc-editor/trunk/php/class.php	2009-11-11 21:07:52 UTC (rev 290531)
@@ -271,133 +271,6 @@
     }

     /**
-     * Log into this application.
-     *
-     * @param $cvsLogin  The login use to identify this user into PHP CVS server.
-     * @param $cvsPasswd The password, in plain text, to identify this user into PHP CVS server.
-     * @param $lang      The language we want to access.
-     * @return An associated array.
-     */
-    function login($cvsLogin, $cvsPasswd, $lang='en') {
-
-        $return = array(); // Value return
-
-        // Is this user already exist on this server ? database check
-        $s = sprintf('SELECT * FROM `users` WHERE `cvs_login`="%s" AND `cvs_passwd`="%s"', $cvsLogin, $cvsPasswd);
-        $r = $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s);
-
-        $n = $r->num_rows;
-
-        if ($n == 0 ) {
-
-            // No match
-            $this->cvsLogin  = $cvsLogin;
-            $this->cvsPasswd = $cvsPasswd;
-            $this->cvsLang   = $lang;
-
-            $s = sprintf('SELECT * FROM `users` WHERE `cvs_login`="%s"', $cvsLogin);
-            $r = $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s);
-
-            $n = $r->num_rows;
-            if ($n == 0 ) {
-
-                //User unknow from this server for now.
-                // Is a valid cvs user ?
-                $r = $this->checkCvsAuth();
-
-                if ($r === TRUE ) {
-
-                    // We register this new valid user
-                    $userID = $this->registerUser();
-
-                    //Store in session
-                    $_SESSION['userID']    = $userID;
-                    $_SESSION['cvsLogin']  = $this->cvsLogin;
-                    $_SESSION['cvsPasswd'] = $this->cvsPasswd;
-                    $_SESSION['lang']      = $this->cvsLang;
-                    $_SESSION['userConf']  = array(
-
-                    "conf_needupdate_diff"        => 'using-exec',
-                    "conf_needupdate_scrollbars"  => 'true',
-                    "conf_needupdate_displaylog"  => 'false',
-
-                    "conf_error_skipnbliteraltag" => 'true',
-                    "conf_error_scrollbars"       => 'true',
-                    "conf_error_displaylog"       => 'false',
-
-                    "conf_reviewed_scrollbars"    => 'true',
-                    "conf_reviewed_displaylog"    => 'false',
-
-                    "conf_allfiles_displaylog"    => 'false',
-
-                    "conf_patch_scrollbars"       => 'true',
-                    "conf_patch_displaylog"       => 'false',
-
-                    "conf_theme"                  => 'themes/empty.css'
-                    );
-
-                    $return['state'] = true;
-
-                } elseif ($r == 'Bad password') {
-                    $return['state'] = false;
-                    $return['msg']   = 'Bad cvs password';
-                } else {
-                    $return['state'] = false;
-                    $return['msg']   = 'unknow from cvs';
-                }
-
-            } else {
-                //User exist, but a bad password is enter
-                $return['state'] = false;
-                $return['msg']   = 'Bad db password';
-            }
-
-            return $return;
-
-        } else {
-
-            $a = $r->fetch_object();
-            // user know on this server
-            $this->cvsLogin  = $cvsLogin;
-            $this->cvsPasswd = $cvsPasswd;
-            $this->cvsLang   = $lang;
-            $this->userConf  = array(
-
-            "conf_needupdate_diff"        => $a->conf_needupdate_diff,
-            "conf_needupdate_scrollbars"  => $a->conf_needupdate_scrollbars,
-            "conf_needupdate_displaylog"  => $a->conf_needupdate_displaylog,
-
-            "conf_error_skipnbliteraltag" => $a->conf_error_skipnbliteraltag,
-            "conf_error_scrollbars"       => $a->conf_error_scrollbars,
-            "conf_error_displaylog"       => $a->conf_error_displaylog,
-
-            "conf_reviewed_scrollbars"    => $a->conf_reviewed_scrollbars,
-            "conf_reviewed_displaylog"    => $a->conf_reviewed_displaylog,
-
-            "conf_allfiles_displaylog"    => $a->conf_allfiles_displaylog,
-
-            "conf_patch_scrollbars"       => $a->conf_patch_scrollbars,
-            "conf_patch_displaylog"       => $a->conf_patch_displaylog,
-
-            "conf_theme"                  => $a->conf_theme
-            );
-
-            // Store in session
-            $_SESSION['userID'] = $a->userID;
-            $_SESSION['cvsLogin'] = $this->cvsLogin;
-            $_SESSION['cvsPasswd'] = $this->cvsPasswd;
-            $_SESSION['lang'] = $this->cvsLang;
-            $_SESSION['userConf'] = $this->userConf;
-
-            $return['state'] = true;
-            $return['msg']   = 'Welcome !';
-
-            return $return;
-        }
-
-    }
-
-    /**
      * Parse a string to find all attributs.
      *
      * @param $tags_attrs The string to parse.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.