Hi Guys,
I have read several threads on the login issue to a bridged cpg with XP Publisher Wizard.
I too cannot login, as when I type username/pass the login screen in the wizard continuosly reappears...
This happens even while I am logged in to CPG with IE.
Is there a work around for this?
I read that someone would need to code this as XP publisher does not support bridged login, and I do not think this should be a big deal, as all the functionality exists already.
Can someone point me to a direction on where to start poking around?
Should I be copying the login function from bridge/udb_base.inc.php to the xp_publish.php?
I found this in udb_base.inc.php
// Simple login by specified username and pass.
// Used for xp publisher login
// Needs override for any BBS that is more complex than straight md5(password)
function login( $username = null, $password = null, $remember = false ) {
$encpassword = md5($password);
// Check for user in users table
$sql = "SELECT {$this->field['user_id']} AS user_id, {$this->field['username']} AS user_name FROM {$this->usertable} WHERE ";
$sql .= "{$this->field['username']} = '$username' AND BINARY {$this->field['password']} = '$encpassword'";
$results = cpg_db_query($sql);
if (mysql_num_rows($results)) {
$USER_DATA = mysql_fetch_assoc($results);
mysql_free_result($results);
return $USER_DATA;
} else {
return false;
}
}
and this in udb_base.inc.php
// Process login information
function process_login()
{
global $CONFIG, $USER; //$PHP_SELF,
global $ONNEXT_SCRIPT, $ONBACK_SCRIPT, $WIZARD_BUTTONS;
global $template_login_success, $template_login_failure,$template_login;
global $lang_login_php, $cpg_udb;
$tt = 'worked';
if ( $USER_DATA = $cpg_udb->login(addslashes($_POST['username']), addslashes($_POST['password'])) ) {
$USER['am'] = 1;
user_save_profile();
$params = array('{WELCOME}' => sprintf($lang_login_php['welcome'], USER_NAME),
'{POST_ACTION}' => trim($CONFIG['site_url'], '/') . '/' . $_SERVER['PHP_SELF'] . '?cmd=publish',
);
echo template_eval($template_login_success, $params);
} else {
$params = array('{ERROR}' => $lang_login_php['err_login'],
'{POST_ACTION}' => trim($CONFIG['site_url'], '/') . '/' . $_SERVER['PHP_SELF'] . '?cmd=publish',
);
echo template_eval($template_login_failure, $params);
}
$ONNEXT_SCRIPT = 'dummy.submit();';
$ONBACK_SCRIPT = 'dummy.submit();';
$WIZARD_BUTTONS = 'true,true,false';
}