Пример #1
0
    function Register_PhpBB_InitPage()
    {
        global $conf, $user;
        include_once REGPHPBB_PATH . 'include/functions.inc.php';
        if (isset($_POST['validate']) and !is_admin()) {
            if (!empty($_POST['use_new_pwd'])) {
                $query = '
SELECT ' . $conf['user_fields']['username'] . ' AS username
FROM ' . USERS_TABLE . '
WHERE ' . $conf['user_fields']['id'] . ' = \'' . $user['id'] . '\'
;';
                list($username) = pwg_db_fetch_row(pwg_query($query));
                PhpBB_Updateuser($user['id'], stripslashes($username), md5($_POST['use_new_pwd']), $_POST['mail_address']);
            }
        }
    }
Пример #2
0
     PhpBB_Linkuser($row['pwg_id'], $row['bb_id']);
 }
 if ($msg_error_Link_Bad == '') {
     array_push($page['infos'], l10n('Sync_Link_Bad') . '<br>' . l10n('Sync_OK'));
 } else {
     $msg_error_Link_Bad = l10n('Sync_Link_Bad') . $msg_error_Link_Bad;
 }
 $query = "\nSELECT pwg.id as pwg_id, pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, PhpBB.user_id as bb_id, PhpBB.user_password as bb_pwd, PhpBB.user_email as bb_eml\nFROM " . PhpBB_USERS_TABLE . " AS PhpBB\nINNER JOIN " . Register_PhpBB_ID_TABLE . " AS link ON link.id_user_PhpBB = PhpBB.user_id\nINNER JOIN " . USERS_TABLE . " as pwg ON link.id_user_pwg = pwg.id\nAND BINARY pwg.username = BINARY PhpBB.username\nORDER BY LOWER(pwg.username)\n;";
 $result = pwg_query($query);
 while ($row = pwg_db_fetch_assoc($result)) {
     if ($row['pwg_pwd'] != $row['bb_pwd'] or $row['pwg_eml'] != $row['bb_eml']) {
         $msg_error_Synchro .= '<br>' . l10n('Sync_User') . stripslashes($row['username']);
         $query = "\nSELECT id, username, password, mail_address\nFROM " . USERS_TABLE . "\nWHERE BINARY id = '" . $row['pwg_id'] . "'\n;";
         $data = pwg_db_fetch_assoc(pwg_query($query));
         if (!empty($data)) {
             PhpBB_Updateuser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);
         }
     }
 }
 if ($msg_error_Synchro == '') {
     array_push($page['infos'], l10n('Sync_DataUser') . '<br>' . l10n('Sync_OK'));
 } else {
     $msg_error_Synchro = l10n('Sync_DataUser') . $msg_error_Synchro;
 }
 $query = "\nSELECT username, mail_address FROM " . USERS_TABLE . "\nWHERE BINARY username <> BINARY 'guest'\nAND id not in (\n  SELECT id_user_pwg FROM " . Register_PhpBB_ID_TABLE . "\n  )\nAND BINARY username not in (\n  SELECT username FROM " . PhpBB_USERS_TABLE . "\n  )\nORDER BY LOWER(username)\n;";
 $result = pwg_query($query);
 while ($row = pwg_db_fetch_assoc($result)) {
     $msg_error_PWG2PhpBB .= '<br>' . l10n('Add_User') . stripslashes($row['username']) . ' (' . $row['mail_address'] . ')';
     $query = "\nSELECT id, username, password, mail_address\nFROM " . USERS_TABLE . "\nWHERE BINARY username = BINARY '" . $row['username'] . "'\nLIMIT 1\n;";
     $data = pwg_db_fetch_assoc(pwg_query($query));
     if (!empty($data)) {