[REQUEST] max sessions

Mods etc.

Moderator: Integra Moderator

[REQUEST] max sessions

PostAuthor: Skywalker » Fri Aug 25, 2006 5:57 am

can someone port this to im?

Code: Select all
############################################################## ## MOD Title]http://mods.db9.dk[/url] ## MOD Description:    This mod will prevent users of connecting##                     to the site, if there is currently the##                     maximal accepted connections.## MOD Version:        0.9.2 ## MOD Compatibility:  2.0.2->2.0.6## ## Installation Level: Easy## Installation Time:  5 Minutes (1mn by EasyMOD of Nuttzy)## Files To Edit:      4##      admin/admin_board.php##      includes/sessions.php##      language/lang_english/lang_admin.php ##      templates/subSilver/admin/board_config.tpl#### Included Files:     1##      max_sessions_db_update.php################################################################ ## For Security Purposes, Please Check: [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] for the ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered ## in our MOD-Database, located at: [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] ############################################################## ## Author Notes: #### 1. Full MOD description## -----------## This mod will prevent users of connecting to the site, if## there is currently the maximal accepted connections. Users## will have to wait, until other users "disaper" from the session## table (5 min).## You will also be able to disallow same IP having more connections.## Note: A connection is in current version kept for 1 min - ## so if a user close one of his/her browsers, the connection## is kept for 1 min.## This can be seen if max number of connections is reached and## the client is closing some of the open windows (browsers),## he/she will only get access again after aprox 1 min.## Same apply for overall connections, it counts all connections## back for 1 min.#### 2. EasyMOD## -----------## This MOD is compatible and can be installed by EasyMOD## of Nuttzy (but is not officially EasyMOD Compliant)!## [url=http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15#]http://area51.phpbb.com/phpBB22/viewfor ... sid=&f=15#[/url]### However, on alpha releases of EM and meanwhile beta or ## final release some actions are NOT performed.## You'll have to do them manually !#### 2.1 SQL commands are not performed## -----------## This MOD need a database update.## Then, in any case if you install this MOD manually or using## an alpha release of EM, please copying the *_db_update.php## in your phpBB root directory, run it with your navigator,## and then delete it from the phpBB root directory.#### Please, do it NOW! Before editing phpBB files by EM or manually!!!## Otherwise, you may have an error message during your next## connection.#### 2.2 Translation are not managed## -----------## Moreover, EM can not already manage actions for any other## language than English (but language intructions are proceed## to all installed languages in order to prevent errors).## So the translations provided with this MOD must be installed## manually if you need them.#### 3. Official last version link## -----------## Meanwhile the phpBB group validation and as the MOD is not yet## in the phpBB MOD database, check this official link for updates...## [url=http://mods.db9.dk/viewtopic.php?t=704#]http://mods.db9.dk/viewtopic.php?t=704#[/url]############################################################### ## MOD History: ## ##   2004-01-05 - Version 0.9.2 ##      - phpBB template & EasyMOD compliance enhancement##      - Deutsch, Dutch, French, Italian & Spanish##        translations now provide with the MOD## ##   ????-??-?? - Version 0.9.1##      - fixed a bug in the template####   ????-??-?? - Version 0.9.0##      - initial BETA ################################################################ ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################### #-----[ COPY ]------------------------------------------------ # copy max_sessions_db_update.php to max_sessions_db_update.php  ## This MOD need a database update.# Then, as you must have now copied the max_sessions_db_update.php file# in your phpBB root directory, run it with your navigator...# [url=http://www.yourWebSite.xxx/phpbbRootDir/max_sessions_db_update.php#]http://www.yourWebSite.xxx/phpbbRootDir ... pdate.php#[/url]# ...and then delete it from the phpBB root directory!!!## Please, do it NOW! Before editing phpBB files by EM or manually!!!# Otherwise, you may have an error message during your next# connection.#  # #-----[ OPEN ]------------------------------------------------ # admin/admin_board.php  # #-----[ FIND ]------------------------------------------------ # "L_ENABLE_PRUNE" =>  # #-----[ AFTER, ADD ]------------------------------------------ #  // Start add - Max sessions MOD'L_MAX_SESSIONS' => $lang['Max_sessions'], 'L_MAX_SESSIONS_EXPLAIN' => $lang['Max_sessions_explain'], 'L_MAX_SESSIONS_IP' => $lang['Max_sessions_ip'], 'L_MAX_SESSIONS_IP_EXPLAIN' => $lang['Max_sessions_ip_explain'], // End add - Max sessions MOD  # #-----[ FIND ]------------------------------------------------ # "PRUNE_NO" =>  # #-----[ AFTER, ADD ]------------------------------------------ #  // Start add - Max sessions MOD'MAX_SESSIONS' => $new['max_sessions'],'MAX_SESSIONS_IP' => $new['max_sessions_ip'],// End add - Max sessions MOD  # #-----[ OPEN ]------------------------------------------------ # includes/sessions.php  # #-----[ FIND ]------------------------------------------------ # if ( !$db->sql_query($sql) || !$db->sql_affectedrows() ){  # #-----[ AFTER, ADD ]------------------------------------------ #  // Start add - Max sessions MOD$sql = "SELECT user_id FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s             WHERE s.session_time >= ".( time() - 90 ) . "             AND u.user_id = s.session_user_id                 GROUP BY s.session_ip, u.username";if( !($result = $db->sql_query($sql)) ){     message_die(CRITICAL_MESSAGE, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);}$total_users = $db->sql_numrows($result);if ( $total_users >= $board_config['max_sessions'] ){     message_die(CRITICAL_MESSAGE, sprintf('Max connections reatched, (%d) please try again later',$board_config['max_sessions']), '', __LINE__, __FILE__, $sql);}  $sql = "SELECT session_user_id FROM ".SESSIONS_TABLE."             WHERE session_time >= ".( time() - 90 ) . "             AND session_ip='".$user_ip."'". (($user_id == ANONYMOUS) ? "" :" AND session_user_id='".$user_id."'" ) ;if( !($result = $db->sql_query($sql)) ){     message_die(CRITICAL_MESSAGE, 'Could not obtain users online information'.$sql, '', __LINE__, __FILE__, $sql);}$total_users = $db->sql_numrows($result);if ( $total_users >= $board_config['max_sessions_ip'] ){     message_die(CRITICAL_MESSAGE, sprintf('Max connections per IP reatched, (%d) please use fewer open windows',$board_config['max_sessions_ip']), '', __LINE__, __FILE__, $sql);}// End add - Max sessions MOD  # #-----[ OPEN ]------------------------------------------------ # language/lang_english/lang_admin.php  # #-----[ FIND ]------------------------------------------------ # ?>  # #-----[ BEFORE, ADD ]----------------------------------------- #  // Start add - Max sessions MOD$lang['Max_sessions'] = 'Max sessions allowed'; $lang['Max_sessions_explain'] = 'This is the max number of sessions, the forum accept'; $lang['Max_sessions_ip'] = 'Max sessions allowed per IP'; $lang['Max_sessions_ip_explain'] = 'This is the max number of sessions per IP, the forum accept'; // End add - Max sessions MOD  # #-----[ OPEN ]------------------------------------------------ # # Make sure to edit this file for every theme your admin uses#templates/subSilver/admin/board_config_body.tpl  # #-----[ FIND ]------------------------------------------------ # {S_DISABLE_BOARD_YES}</tr>  # #-----[ AFTER, ADD ]------------------------------------------ #  <Start><tr>     <td>{L_MAX_SESSIONS}<br><span>{L_MAX_SESSIONS_EXPLAIN}</span></td>     <td><input></td></tr><tr>     <td>{L_MAX_SESSIONS_IP}<br><span>{L_MAX_SESSIONS_IP_EXPLAIN}</span></td>     <td><input></td></tr><End>  # #-----[ SAVE/CLOSE ALL FILES ]-------------------------------- # # EoM
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: [REQUEST] max sessions

PostAuthor: found it » Wed Aug 30, 2006 2:28 am

This should work quite easily with your integramod forum as I found all the finds that were needed..

You might need to change the way it looks if you are using a differnet template but i see no reason for it to be a problem...

:mrgreen:
Last edited by found it on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http]themes.[/url]
http://www.founditforum.com :: [url=http]Joining people together[/url]

[url=http][img=left]http://www.bbful.com/bbful_banner2.png[/img][/url]
User avatar
found it
Dev Team
Dev Team
 
Posts: 792
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 3:29 am
Cash on hand: 0.00


Return to IntegraMOD Modifications

Who is online

Registered users: Bing [Bot], Majestic-12 [Bot]