Lines Matching refs:this

71         if (method_exists(get_parent_class($this), '__construct')) {
75 $this->cando['addUser'] = false; // Can Users be created?
76 $this->cando['delUser'] = false; // Can Users be deleted?
77 $this->cando['modLogin'] = false; // Can login names be changed?
78 $this->cando['modPass'] = false; // Can passwords be changed?
79 $this->cando['modName'] = false; // Can real names be changed?
80 $this->cando['modMail'] = false; // Can emails be changed?
81 $this->cando['modGroups'] = false; // Can groups be changed?
82 $this->cando['getUsers'] = true; // Can a (filtered) list of users be retrieved?
83 $this->cando['getUserCount']= true; // Can the number of users be retrieved?
84 $this->cando['getGroups'] = true; // Can a list of available groups be retrieved?
85 $this->cando['external'] = true; // Does the module do external auth checking?
86 $this->cando['logout'] = true; // Can the user logout again?
89 $this->dbglog('PDO extension for PHP not found.');
90 $this->success = false;
93 $this->success = $this->load_configuration();
95 if (!$this->success) {
96 msg($this->getLang('config_error'), -1);
104 $this->phpbb_disconnect();
105 $this->_cache = null;
106 if (method_exists(get_parent_class($this), '__destruct')) {
117 $class_name = @get_class($this);
144 if (!empty($this->_phpbb_conf['url'])) {
145 return $this->_phpbb_conf['url'];
147 if ($this->use_phpbb_cache()) {
148 $result = unserialize($this->_cache->retrieveCache(false));
150 $this->_phpbb_conf['url'] = $result['url'];
153 if (!empty($this->_phpbb_conf['url'])) {
154 return $this->_phpbb_conf['url'];
156 if (!$this->phpbb_connect()) {
160 FROM {$this->_phpbb_conf['table_prefix']}config
162 $result = $this->_phpbb_sql_link->prepare($query);
164 $this->dbglog('error while preparing query for phpBB URL');
168 $this->dbglog('error while executing query for phpBB URL');
255 $this->_cache_duration = intval($this->getConf('phpbb_cache'));
256 $depends = array('age' => self::CACHE_DURATION_UNIT * $this->_cache_duration);
257 $cache = new cache('authphpbb3_getUserData_' . $user, $this->_cache_ext_name);
260 if (($this->_cache_duration > 0) && $cache->useCache($depends)) {
264 if (!$this->phpbb_connect()) {
268 FROM {$this->_phpbb_conf['table_prefix']}users
270 $result = $this->_phpbb_sql_link->prepare($query);
272 $this->dbglog('error while preparing query for user data');
275 if (!$result->execute(array($this->clean_username($user)))) {
276 $this->dbglog('error while executing query for user data');
280 $this->_phpbb_user_type = (int)$row['user_type'];
281 $this->_phpbb_user_id = (int)$row['user_id'];
282 $this->_phpbb_username = $row['username'];
283 $this->_phpbb_user_email = $row['user_email'];
286 $this->get_phpbb_user_groups();
287 $this->get_phpbb_url();
289 'name' => $this->_phpbb_username,
290 'username' => $this->_phpbb_username,
291 'mail' => $this->_phpbb_user_email,
292 'phpbb_user_id' => $this->_phpbb_user_id,
293 … 'phpbb_profile' => $this->_phpbb_conf['url'] . '/memberlist.php?mode=viewprofile&u=' .
294 $this->_phpbb_user_id,
295 'grps' => $this->_phpbb_groups
312 if (!$this->phpbb_connect()) {
350 FROM {$this->_phpbb_conf['table_prefix']}users
355 $result = $this->_phpbb_sql_link->prepare($query);
357 $this->dbglog('error while preparing query for users data');
368 $this->dbglog('error while executing query for users data');
379 … 'phpbb_profile' => $this->_phpbb_conf['url'] . '/memberlist.php?mode=viewprofile&u=' .
384 FROM {$this->_phpbb_conf['table_prefix']}groups g,
385 {$this->_phpbb_conf['table_prefix']}users u,
386 {$this->_phpbb_conf['table_prefix']}user_group ug
388 $resgrp = $this->_phpbb_sql_link->prepare($query);
390 $this->dbglog('error while executing query for ' . $row['user_id'] . ' groups');
428 if (!$this->phpbb_connect()) {
441 FROM {$this->_phpbb_conf['table_prefix']}groups
443 $result = $this->_phpbb_sql_link->prepare($query);
445 $this->dbglog('error while preparing query for groups data');
451 $this->dbglog('error while executing query for groups data');
473 $users = $this->retrieveUsers(0, 0, $filter);
485 if (method_exists(get_parent_class($this), 'logOff')) {
488 if (empty($this->_phpbb_user_session_id)) {
489 $this->get_phpbb_cookie_name();
490 if (empty($this->_phpbb_conf['cookie_name'])) {
493 $phpbb_cookie_sid_name = $this->_phpbb_conf['cookie_name'] . '_sid';
495 $this->_phpbb_user_session_id = $_COOKIE[$phpbb_cookie_sid_name];
498 if (!empty($this->_phpbb_user_session_id) &&
499 ($this->get_phpbb_url() !== false) &&
500 $this->_phpbb_user_id) {
503 … $url = $this->_phpbb_conf['url'] . '/ucp.php?mode=logout&sid=' . $this->_phpbb_user_session_id;
516 if ($this->use_phpbb_cache()) {
517 $this->_phpbb_conf = unserialize($this->_cache->retrieveCache(false));
519 $this->_cache->removeCache();
520 …$this->_phpbb_conf['root_path'] = DOKU_INC . rtrim(trim($this->getConf('phpbb_root_path')), '/') .…
521 $this->_phpbb_conf['phpEx'] = substr(strrchr(__FILE__, '.'), 1);
522 … if (!@file_exists($this->_phpbb_conf['root_path'] . 'config.' . $this->_phpbb_conf['phpEx'])) {
523 $this->dbglog('phpBB installation not found');
526 include($this->_phpbb_conf['root_path'] . 'config.' . $this->_phpbb_conf['phpEx']);
527 $this->_phpbb_conf['dbms'] = $dbms;
528 $this->_phpbb_conf['dbhost'] = empty($dbhost) ? '127.0.0.1' : $dbhost;
529 $this->_phpbb_conf['dbport'] = $dbport;
530 $this->_phpbb_conf['dbname'] = $dbname;
531 $this->_phpbb_conf['dbuser'] = $dbuser;
532 $this->_phpbb_conf['dbpasswd'] = $dbpasswd;
533 $this->_phpbb_conf['table_prefix'] = $table_prefix;
535 if (empty($this->_phpbb_conf[$member])) {
536 $this->dbglog("phpBB config variable {$member} not set");
540 if ($this->get_phpbb_url() === false) {
541 $this->dbglog('cannot get phpBB URL');
544 if (!$this->get_phpbb_cookie_name()) {
545 $this->dbglog('cannot get phpBB cookie name');
548 $this->_cache->storeCache(serialize($this->_phpbb_conf));
550 return (!empty($this->_phpbb_conf['url']) &&
551 !empty($this->_phpbb_conf['cookie_name']));
560 if ($this->_cache === null) {
561 $this->_cache = new cache('authphpbb3', $this->_cache_ext_name);
563 return $this->_cache;
574 $this->get_phpbb_cache();
575 $this->_cache_duration = intval($this->getConf('phpbb_cache'));
576 if ($this->_cache_duration > 0) {
577 $depends['age'] = self::CACHE_DURATION_UNIT * $this->_cache_duration;
581 return $this->_cache->useCache($depends);
590 if (!$this->_phpbb_db_link) {
591 $host = strtolower(end(explode('\\', $this->_phpbb_conf['dbms'])));
595 if (!empty($this->_phpbb_conf['dbport'])) {
596 $port = ';port=' . intval($this->_phpbb_conf['dbport']);
598 $dsn = ':host=' . $this->_phpbb_conf['dbhost'] . $port .
599 ';dbname=' . $this->_phpbb_conf['dbname'];
605 $this->_phpbb_sql_link = new PDO(
607 $this->_phpbb_conf['dbuser'],
608 $this->_phpbb_conf['dbpasswd']);
612 ';user=' . $this->_phpbb_conf['dbuser'] .
613 ';password=' . $this->_phpbb_conf['dbpasswd'];
614 $this->_phpbb_sql_link = new PDO($dsn);
615 $this->_phpbb_sql_link->exec("SET NAMES 'UTF8'");
619 $this->_phpbb_sql_link = new PDO(
621 $this->_phpbb_conf['dbuser'],
622 $this->_phpbb_conf['dbpasswd']);
633 … $dsn = $host . ':' . $this->_phpbb_conf['root_path'] . $this->_phpbb_conf['dbhost'];
634 $this->_phpbb_sql_link = new PDO($dsn);
637 msg($this->getLang('database_support'), -1);
641 $this->dbglog('cannot connect to database server (' . $e->getMessage() .')');
642 msg($this->getLang('database_error'), -1);
643 $this->_phpbb_db_link = null;
654 if ($this->_phpbb_db_link !== null) {
655 $this->_phpbb_db_link = null;
665 if (!empty($this->_phpbb_conf['cookie_name'])) {
668 if ($this->use_phpbb_cache()) {
669 $result = unserialize($this->_cache->retrieveCache(false));
671 $this->_phpbb_conf['cookie_name'] = $result['cookie_name'];
674 if (!empty($this->_phpbb_conf['cookie_name'])) {
677 if (!$this->phpbb_connect()) {
682 FROM {$this->_phpbb_conf['table_prefix']}config
684 $result = $this->_phpbb_sql_link->prepare($query);
686 $this->dbglog('error while preparing query for cookie.');
690 $this->dbglog('error while executing query for cookie.');
694 $this->_phpbb_conf['cookie_name'] = $row['config_value'];
706 $this->_phpbb_groups = array();
707 $this->_phpbb_user_id = filter_var($this->_phpbb_user_id, FILTER_VALIDATE_INT);
708 if (!$this->_phpbb_user_id) {
711 if (!$this->phpbb_connect()) {
715 FROM {$this->_phpbb_conf['table_prefix']}groups g,
716 {$this->_phpbb_conf['table_prefix']}users u,
717 {$this->_phpbb_conf['table_prefix']}user_group ug
719 $result = $this->_phpbb_sql_link->prepare($query);
721 $this->dbglog('error while preparing query for user\'s groups');
724 if (!$result->execute(array($this->_phpbb_user_id))) {
725 $this->dbglog('error while executing query for user\'s groups');
729 $this->_phpbb_groups[] = $row['group_name'];
732 if ($this->_phpbb_user_type === 3) {
733 $this->_phpbb_groups[] = 'admin';
746 if (!$this->phpbb_connect()) {
749 if (!$this->get_phpbb_cookie_name()) {
752 $phpbb_cookie_user_sid = $this->_phpbb_conf['cookie_name'] . '_sid';
753 $phpbb_cookie_user_id = $this->_phpbb_conf['cookie_name'] . '_u';
754 $this->_phpbb_user_session_id =
758 if (empty($this->_phpbb_user_session_id) || !ctype_xdigit($this->_phpbb_user_session_id)) {
759 $this->dbglog('invalid SID in user\'s cookie ' .
760 … '(SID=' . $phpbb_cookie_user_sid . ', Value=' . $this->_phpbb_user_session_id . ')');
765 FROM {$this->_phpbb_conf['table_prefix']}sessions
767 $result = $this->_phpbb_sql_link->prepare($query);
769 $this->dbglog('error while preparing query for session');
772 if (!$result->execute(array($this->_phpbb_user_session_id))) {
773 $this->dbglog('error while executing query for session');
778 $this->dbglog('invalid SID/User ID pair');
783 $this->_phpbb_user_id = (int)$row['session_user_id'];
784 $this->_phpbb_sessiontime = $row['session_time'];
789 if ($current_time > $this->_phpbb_sessiontime) {
790 $query = "UPDATE {$this->_phpbb_conf['table_prefix']}sessions
793 $result = $this->_phpbb_sql_link->prepare($query);
795 $this->dbglog('error while preparing query for session update');
798 if (!$result->execute(array($current_time, $this->_phpbb_user_session_id))) {
799 $this->dbglog('error while executing query for session update');
804 if ($this->_phpbb_user_id === 1) {
809 FROM {$this->_phpbb_conf['table_prefix']}users
811 $result = $this->_phpbb_sql_link->prepare($query);
813 $this->dbglog('error while preparing query for username');
816 if (!$result->execute(array($this->_phpbb_user_id))) {
817 $this->dbglog('error while executing query for username');
821 $this->_phpbb_user_type = (int)$row['user_type'];
822 $this->_phpbb_username = $row['username'];
823 $this->_phpbb_user_email = $row['user_email'];
827 $this->get_phpbb_user_groups();