Subversion Repositories Applications.papyrus

Rev

Rev 1173 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1173 Rev 1713
Line 18... Line 18...
18
 * @package    Auth
18
 * @package    Auth
19
 * @author     Stoyan Stefanov <ssttoo@gmail.com>
19
 * @author     Stoyan Stefanov <ssttoo@gmail.com>
20
 * @author     Adam Ashley <aashley@php.net>
20
 * @author     Adam Ashley <aashley@php.net>
21
 * @copyright  2001-2006 The PHP Group
21
 * @copyright  2001-2006 The PHP Group
22
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
22
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
23
 * @version    CVS: $Id: SAP.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
23
 * @version    CVS: $Id: SAP.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $
24
 * @link       http://pear.php.net/package/Auth
24
 * @link       http://pear.php.net/package/Auth
25
 * @since      File available since Release 1.4.0
25
 * @since      File available since Release 1.4.0
26
 */
26
 */
Line 27... Line 27...
27
 
27
 
Line 46... Line 46...
46
 * @package    Auth
46
 * @package    Auth
47
 * @author     Stoyan Stefanov <ssttoo@gmail.com>
47
 * @author     Stoyan Stefanov <ssttoo@gmail.com>
48
 * @author     Adam Ashley <aashley@php.net>
48
 * @author     Adam Ashley <aashley@php.net>
49
 * @copyright  2001-2006 The PHP Group
49
 * @copyright  2001-2006 The PHP Group
50
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
50
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
51
 * @version    Release: 1.4.3  File: $Revision: 1.1 $
51
 * @version    Release: 1.5.4  File: $Revision: 1.2 $
52
 * @since      Class available since Release 1.4.0
52
 * @since      Class available since Release 1.4.0
53
 */
53
 */
54
class Auth_Container_SAP extends Auth_Container {
54
class Auth_Container_SAP extends Auth_Container {
Line 55... Line 55...
55
 
55
 
56
    // {{{ properties
56
    // {{{ properties
57
    
57
 
58
    /**
58
    /**
59
     * @var array Default options
59
     * @var array Default options
60
     */
60
     */
61
    var $options = array(
61
    var $options = array(
Line 114... Line 114...
114
     * @param string Password
114
     * @param string Password
115
     * @return boolean TRUE on success (valid user), FALSE otherwise
115
     * @return boolean TRUE on success (valid user), FALSE otherwise
116
     */
116
     */
117
    function fetchData($username, $password)
117
    function fetchData($username, $password)
118
    {
118
    {
-
 
119
        $this->log('Auth_Container_SAP::fetchData() called.', AUTH_LOG_DEBUG);
119
        $connection_options = $this->options;
120
        $connection_options = $this->options;
120
        $connection_options['USER'] = $username;
121
        $connection_options['USER'] = $username;
121
        $connection_options['PASSWD'] = $password;
122
        $connection_options['PASSWD'] = $password;
122
        $rfc = saprfc_open($connection_options);
123
        $rfc = saprfc_open($connection_options);
123
        if (!$rfc) {
124
        if (!$rfc) {
Line 128... Line 129...
128
            }
129
            }
129
            PEAR::raiseError($message, null, null, null, @$erorr['all']);
130
            PEAR::raiseError($message, null, null, null, @$erorr['all']);
130
            return false;
131
            return false;
131
        } else {
132
        } else {
132
            if (!empty($this->options['GETSSO2'])) {
133
            if (!empty($this->options['GETSSO2'])) {
-
 
134
                $this->log('Attempting to retrieve SSO2 ticket.', AUTH_LOG_DEBUG);
133
                if ($ticket = @saprfc_get_ticket($rfc)) {
135
                if ($ticket = @saprfc_get_ticket($rfc)) {
134
                    $this->options['MYSAPSSO2'] = $ticket;
136
                    $this->options['MYSAPSSO2'] = $ticket;
135
                    unset($this->options['GETSSO2']);
137
                    unset($this->options['GETSSO2']);
136
                    $this->_auth_obj->setAuthData('sap', $this->options);
138
                    $this->_auth_obj->setAuthData('sap', $this->options);
137
                } else {
139
                } else {
Line 139... Line 141...
139
                }
141
                }
140
            }
142
            }
141
            @saprfc_close($rfc);
143
            @saprfc_close($rfc);
142
            return true;
144
            return true;
143
        }
145
        }
144
    
146
 
145
    }
147
    }
Line 146... Line 148...
146
 
148
 
147
    // }}}
149
    // }}}