Turiu problema, kodel mano puslapyje nera nuorodos i kitu vartotoju prisiregistravimosi?
Reikia kazka siusti ar kaip cia?!?
Aciu kas pades
![Smiley :)](./images/smilies/smiley.gif)
Moderator: Augustas
Ar issisprendė klaida?acp wrote: Padariau grupe register bet vistike klaida meta
""secam wrote: Gal galima žvilgtelt? Gal čia ne pačio cmsms bėda, o html/css šablono...
Bandysiu tada taip išsisukti. O ka su "TAB" daryti? Jis irgi paslenka.secam wrote: pridėti į naudojamąjį CSS tokią eilutė
jei teik pamažinti tik tą eilutę, o jei reik pamažinti visus formos elementus, tuomet pridėti šią eilutęCode: Select all
#m713a0feu_input_username { FONT-SIZE: 10px;}
Code: Select all
#m713a0moduleform_1 input { FONT-SIZE: 10px;}
O formos templeitas yra "Users & Groups » Frontend User Management > Login Template"{$prompt_username}
{$input_username}
{$prompt_password}
{$input_password}
Code: Select all
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// This is an example on how to build an authentication server for phpBB
//
// Most of what is done here comes from the KB (http://www.phpbb.com/kb/article.php?article_id=143)
//
// The code looks like this:
//
// define('IN_PHPBB', true);
// $phpbb_root_path = './';
// include($phpbb_root_path . 'extension.inc');
// include($phpbb_root_path . 'common.'.$phpEx);
//
// //
// // Start session management
// //
// $userdata = session_pagestart($user_ip, PAGE_INDEX);
// init_userprefs($userdata);
// //
// // End session management
//
//
// Instead of calling session_pagestart I copy-pasted the code here.
//
// I've not had any problems with this code, but someone with more knowledge of the phpBB
// authentication system should have a look at it.
//
// This file is placed in $phpbb_root_path/mods/auth/
//
//
///////////////////////////////////////////
//
// phpBB includes
//
define('IN_PHPBB', true);
$phpbb_root_path = '../../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
///////////////////////////////////////////
//
// Start the SOAP server.
//
// I've used NuSOAP, http://dietrich.ganx4.com/nusoap/
//
include($phpbb_root_path . '../soap/nusoap.php');
$s = new soap_server;
$s->register('authenticate');
$s->service($HTTP_RAW_POST_DATA);
///////////////////////////////////////////
//
// The authenticate function.
// It is basically the session_pagestart function from phpBB
// I've put comments so you can see what code I've added.
//
function authenticate($ip, $get_vars, $cookie_vars){
///////////////////////////////////////////
//
// Since session_pagestart wasn't called normally
// we have to set the variables needed.
//
$user_ip = $ip;
$thispage_id = PAGE_INDEX;
////////////////////////////////////////////
global $db, $lang, $board_config;
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;
///////////////////////////////////////////
//
// Replace $HTTP_COOKIE_VARS and $HTTP_GET_VARS
// with information from the client
//
$HTTP_GET_VARS = unserialize($get_vars);
$HTTP_COOKIE_VARS = unserialize($cookie_vars);
///////////////////////////////////////////////
$cookiename = $board_config['cookie_name'];
$cookiepath = $board_config['cookie_path'];
$cookiedomain = $board_config['cookie_domain'];
$cookiesecure = $board_config['cookie_secure'];
$current_time = time();
unset($userdata);
if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )
{
$sessiondata = isset( $HTTP_COOKIE_VARS[$cookiename . '_data'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();
$session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
$sessionmethod = SESSION_METHOD_COOKIE;
}
else
{
$sessiondata = array();
$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
$sessionmethod = SESSION_METHOD_GET;
}
//
if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
$session_id = '';
}
$thispage_id = (int) $thispage_id;
//
// Does a session exist?
//
if ( !empty($session_id) )
{
//
// session_id exists so go ahead and attempt to grab all
// data in preparation
//
$sql = "SELECT u.*, s.*
FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = '$session_id'
AND u.user_id = s.session_user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
}
$userdata = $db->sql_fetchrow($result);
//
// Did the session exist in the DB?
//
if ( isset($userdata['user_id']) )
{
//
// Do not check IP assuming equivalence, if IPv4 we'll check only first 24
// bits ... I've been told (by vHiker) this should alleviate problems with
// load balanced et al proxies while retaining some reliance on IP security.
//
$ip_check_s = substr($userdata['session_ip'], 0, 6);
$ip_check_u = substr($user_ip, 0, 6);
if ($ip_check_s == $ip_check_u)
{
$SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';
//
// Only update session DB a minute or so after last update
//
if ( $current_time - $userdata['session_time'] > 60 )
{
// A little trick to reset session_admin on session re-usage
$update_admin = (!defined('IN_ADMIN') && $current_time - $userdata['session_time'] > ($board_config['session_length']+60)) ? ', session_admin = 0' : '';
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_time = $current_time, session_page = $thispage_id$update_admin
WHERE session_id = '" . $userdata['session_id'] . "'";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
}
if ( $userdata['user_id'] != ANONYMOUS )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $thispage_id
WHERE user_id = " . $userdata['user_id'];
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
}
}
session_clean($userdata['session_id']);
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
}
///////////////////////////////////////////
//
// If we have come this far, the user is logged in.
//
// return userdata and cookies (are any new set?)
// to the client
//
init_userprefs($userdata);
if( $userdata['session_logged_in'] )
{
global $HTTP_COOKIE_VARS;
$params = array(
'cookie_vars' => serialize($HTTP_COOKIE_VARS),
'userdata' => serialize($userdata),
'logged_in' => 1
);
return $params;
}
// old code
//return $userdata;
//////////////////////////////////////////
}
}
}
//
// If we reach here then no (valid) session exists. So we'll create a new one,
// using the cookie user_id if available to pull basic user prefs.
//
$user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;
if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )
{
message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);
}
///////////////////////////////////////////
//
// If we reach here, the user is not logged in.
//
if( !$userdata['session_logged_in'] )
{
$params = array('logged_in => 0' );
return $params;
}
////////////////////////////////////////////
}
Code: Select all
function phpbb_auth() {
////////////////////////////////////////////////////////////////////////
//
// A small example to show how you can use the authentication server
//
global $HTTP_GET_VARS;
global $HTTP_COOKIE_VARS;
////////////////////////////////////////////////////////////////////////
//
// The following three lines are from phpBB
// This should be done at the server-side but this was easier.
//
$dotquad_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
$ip_sep = explode('.', $dotquad_ip);
$user_ip = sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);
////////////////////////////////////////////////////////////////////////
//
// Include SOAP
// Create a client
// The URL should be the full URL to the server. Rembember, it's a HTTP request.
// Call the server
//
include('../soap/nusoap.php');
$client = new soapclient('PUT SOAP SERVER URL HERE');
$params = array(
'ip' => $user_ip,
'get_vars' => serialize($HTTP_GET_VARS),
'cookie_vars' => serialize($HTTP_COOKIE_VARS));
$reply = $client->call('authenticate', $params);
if ($reply['logged_in']){
$HTTP_COOKIE_VARS = unserialize($reply['cookie_vars']);
$userdata = unserialize($reply['userdata']);
/////////////////////////////////////////////
//
// Authenticated!
//
// And we have full access to $userdata
//
// We can do stuff like this:
//
$r = "Logged in as: ".$userdata['username'];
$r .= "<br ><a href=\"../forum/login.php?logout=true&sid=";
$r .= $userdata['session_id'];
$r .= "&redirect=../cms/index.php";
$r .= "\">Log out</a>";
}
else{
/////////////////////////////////////////////
//
// If the authentication fails we can for example
// make a login form.
//
$r = "";
$r.='<form action="../forum/login.php" method="post" target="_top">';
$r.='Username:<br />';
$r.='<input type="text" name="username" size="20" maxlength="40" value="" /><br />';
$r.='Password:<br />';
$r.='<input type="password" name="password" size="20" maxlength="25" /><br />';
$r.='<br /> <br />';
$r.='<input type="hidden" name="redirect" value="../cms/index.php" />';
$r.='<input type="hidden" name="outside" value="1" />';
$r.='<span align="center"><input type="submit" class="mainoption" name="login" value="Logga in" /></span';
$r.='<br /> <br />';
$r.='</form>';
$r = utf8_encode($r); // This is needed for swedish letters.
}
return $r;
}