Tinklalapije registracija
Moderator: Augustas
Tinklalapije registracija
Sveiki!
Turiu problema, kodel mano puslapyje nera nuorodos i kitu vartotoju prisiregistravimosi?
Reikia kazka siusti ar kaip cia?!?
Aciu kas pades
Turiu problema, kodel mano puslapyje nera nuorodos i kitu vartotoju prisiregistravimosi?
Reikia kazka siusti ar kaip cia?!?
Aciu kas pades
Re: Tinklalapije registracija
O gal gali pasakyti kaip ji aktyvuoti nes viska instaliavau o kaip nera tos registracijo taip nera
Re: Tinklalapije registracija
Na kiek supratau tai i sablona reikia ideti
{cms_module module=SelfRegistration group=usergroup}
sita eilute. Ir dar kazka su tais lygiais tik vat neisivaizduoju kaip.
{cms_module module=SelfRegistration group=usergroup}
sita eilute. Ir dar kazka su tais lygiais tik vat neisivaizduoju kaip.
Re: Tinklalapije registracija
Padariau grupe register bet vistike klaida meta
Re: Tinklalapije registracija
Ar issisprendė klaida?acp wrote: Padariau grupe register bet vistike klaida meta
Nes man irgi meta: "Klaida! Group name specified does not exist"
Kazkaip nesusišneka Selfregistration modulis su FrontEndUsers moduliu. Sukuriu grupes ir userius FrontEndUser modulyje(rodo yra 3 users), o Selfregistration rodo 0 useriu. Tai kaip juos susieti?
Last edited by tany on Wed Mar 24, 2010 8:03 am, edited 1 time in total.
Re: Tinklalapije registracija
Parašius vietoj {cms_module module=SelfRegistration group=usergruop}
{cms_module module=SelfRegistration group=grupes pavadinimas konkretus} suveikė.
Bet o jei aš turiu daugiau grupių, kas tada?
Jau sugalvojau, visus registruosiu i naujokų grupę, o po to pati skirstisiu. Tai klausimų nebeliko
{cms_module module=SelfRegistration group=grupes pavadinimas konkretus} suveikė.
Bet o jei aš turiu daugiau grupių, kas tada?
Jau sugalvojau, visus registruosiu i naujokų grupę, o po to pati skirstisiu. Tai klausimų nebeliko
Last edited by tany on Wed Mar 24, 2010 9:00 am, edited 1 time in total.
Re: Tinklalapije registracija
Benaršydamas radau tokią informaciją:
Hiding Private Content in CMS Made Simple
How to limit content and pages to only certain authorized users
http://calguy1000.com/uploads/1/Hiding_Private_Content_in_CMS_Made_Simple-pdf.html
Gal kam pravers beje tai anglų kalba.
Hiding Private Content in CMS Made Simple
How to limit content and pages to only certain authorized users
http://calguy1000.com/uploads/1/Hiding_Private_Content_in_CMS_Made_Simple-pdf.html
Gal kam pravers beje tai anglų kalba.
Re: Tinklalapije registracija
Sveiki, nu ka susiduriau vėl su probelma, labiau del loginimosi ne registracijos. Bet kadangi sritis panasi, tai rasau čia.
Mano prisijungimo laukas yra desinei pusei, t.y. 3 stulpelyje. Ir kai rašau Loginą(mano atveju elektroninį paštą) į laukelį, tai jei jis yra ilgesnis nei tuo momentu telpa i matoma laukelį, tai visas loginimosi modulis pasislenka, t.y. prisijungti migtuka beveik nesimato visai nuvaziuoja po 2 stulpeliu. Tas pats vyksta, jei po Logino parašymo paspaudi "Tab" migtuką.
Ka daryti?
Mano prisijungimo laukas yra desinei pusei, t.y. 3 stulpelyje. Ir kai rašau Loginą(mano atveju elektroninį paštą) į laukelį, tai jei jis yra ilgesnis nei tuo momentu telpa i matoma laukelį, tai visas loginimosi modulis pasislenka, t.y. prisijungti migtuka beveik nesimato visai nuvaziuoja po 2 stulpeliu. Tas pats vyksta, jei po Logino parašymo paspaudi "Tab" migtuką.
Ka daryti?
Re: Tinklalapije registracija
""secam wrote: Gal galima žvilgtelt? Gal čia ne pačio cmsms bėda, o html/css šablono...
Last edited by tany on Fri Apr 09, 2010 8:55 pm, edited 1 time in total.
Re: Tinklalapije registracija
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;}
Last edited by tany on Sat Apr 03, 2010 8:50 am, edited 1 time in total.
Re: Tinklalapije registracija
Registracijos laukelių ilgius galima lasikeisti "Users & Groups » Frontend User Management > Preferences > Field Settings:"
Parasčiausias taisymas - laukelius perkelti į kitą eilutę nei jų pavadinimai,
Parasčiausias taisymas - laukelius perkelti į kitą eilutę nei jų pavadinimai,
O formos templeitas yra "Users & Groups » Frontend User Management > Login Template"{$prompt_username}
{$input_username}
{$prompt_password}
{$input_password}
Re: Tinklalapije registracija
Ačiū, viska sutvarkiau.
O gal kas dabar žino ar imanoma susinchronizuoti puslapio registracija su phpBB forumu?
T.y. vartotojui prisijungusiam prie puslapio nebereiketu forume vėl logintis.
O gal kas dabar žino ar imanoma susinchronizuoti puslapio registracija su phpBB forumu?
T.y. vartotojui prisijungusiam prie puslapio nebereiketu forume vėl logintis.
Re: Tinklalapije registracija
Panasu kad su sinchronizacija ne taip paprasta... Radau tik kad phpBB2 buvo modulis senoj versijoj, o dabar nieks nepalaiko .
Dar radau tokia info: "We are using CMSMS - http://www.cmsmadesimple.org/
I think I have solved the problem though.
First I made a SOAP server that can authenticate users in phpBB if it gets ip, get_vars and cookie_vars.
Then I made a SOAP client in CMSMS that calls the server with the required variables.
It seems to work. I’ll test it for a few days and see what happens. This type of solution should work for any project that needs phpBB integration."
"As I've said in the comments below someone with more knowledge of phpBB authenticaton system should have a look at this. It works for me however.
Please read ALL comments before using the code.
Use this at your own risk.. bla bla bla "
This is the server.
And this is the client.
Bet pati sitame reikale nieko nesuprantu
Dar radau tokia info: "We are using CMSMS - http://www.cmsmadesimple.org/
I think I have solved the problem though.
First I made a SOAP server that can authenticate users in phpBB if it gets ip, get_vars and cookie_vars.
Then I made a SOAP client in CMSMS that calls the server with the required variables.
It seems to work. I’ll test it for a few days and see what happens. This type of solution should work for any project that needs phpBB integration."
"As I've said in the comments below someone with more knowledge of phpBB authenticaton system should have a look at this. It works for me however.
Please read ALL comments before using the code.
Use this at your own risk.. bla bla bla "
This is the server.
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;
}
Last edited by tany on Fri Apr 09, 2010 10:52 pm, edited 1 time in total.
Re: Tinklalapije registracija
Ir dar norejau paklausti del prisiloginimo: kur buna uzdėti varnelę, kad įsiminti jungimo duomenis. Kaip ja padaryti? Dabar standartiškai nėra tokios galimybės.