mirror of
				https://github.com/Mibew/i18n.git
				synced 2025-10-31 17:31:05 +03:00 
			
		
		
		
	usernamepattern, usercanchangename options in db, done
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@177 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
		
							parent
							
								
									19b24bf50e
								
							
						
					
					
						commit
						e0d80f3c61
					
				| @ -182,10 +182,11 @@ function print_thread_messages($thread, $token, $lastid, $isuser, $format, $agen | ||||
| } | ||||
| 
 | ||||
| function get_user_name($username, $addr, $id) { | ||||
| 	global $presentable_name_pattern; | ||||
| 	global $settings; | ||||
| 	loadsettings(); | ||||
| 	return str_replace("{addr}", $addr, | ||||
| 			str_replace("{id}", $id, | ||||
| 			str_replace("{name}", $username, $presentable_name_pattern))); | ||||
| 			str_replace("{name}", $username, $settings['usernamepattern']))); | ||||
| } | ||||
| 
 | ||||
| function is_ajax_browser($browserid,$ver,$useragent) { | ||||
| @ -254,7 +255,7 @@ function needsFramesrc() { | ||||
| } | ||||
| 
 | ||||
| function setup_chatview_for_user($thread,$level) { | ||||
| 	global $page, $webimroot, $user_can_change_name, $settings; | ||||
| 	global $page, $webimroot, $settings; | ||||
| 	loadsettings(); | ||||
| 	$page = array(); | ||||
| 	$page['agent'] = false; | ||||
| @ -267,7 +268,7 @@ function setup_chatview_for_user($thread,$level) { | ||||
| 	$page['ct.chatThreadId'] = $thread['threadid']; | ||||
| 	$page['ct.token'] = $thread['ltoken']; | ||||
| 	$page['ct.user.name'] = topage($thread['userName']); | ||||
| 	$page['canChangeName'] = $user_can_change_name; | ||||
| 	$page['canChangeName'] = $settings['usercanchangename'] == "1"; | ||||
| 
 | ||||
| 	$page['ct.company.name'] = topage($settings['title']); | ||||
| 	$page['ct.company.chatLogoURL'] = topage($settings['logo']); | ||||
|  | ||||
| @ -433,7 +433,7 @@ $settings = array( | ||||
| 	'logo' => '', | ||||
| 	'enableban' => '0', | ||||
| 	'usernamepattern' => '{name}', | ||||
| 	'usercanchangename' => true | ||||
| 	'usercanchangename' => '1' | ||||
| ); | ||||
| $settingsloaded = false; | ||||
| $settings_in_db = array(); | ||||
|  | ||||
| @ -62,16 +62,6 @@ $available_locales = array("en", "ru"); | ||||
| $home_locale = "ru";						/* native name will be used in this locale */ | ||||
| $default_locale = "en";						/* if user does not provide known lang */ | ||||
| 
 | ||||
| /* | ||||
|  *   Allows users to change their names | ||||
|  */ | ||||
| $user_can_change_name = true; | ||||
| 
 | ||||
| /* | ||||
|  *   How to build presentable visitor name from {name}, {id} or {addr}. Default: {name} | ||||
|  */ | ||||
| $presentable_name_pattern = "{name}"; | ||||
| 
 | ||||
| /* | ||||
|  *   Method of getting information about remote user. For example, you could | ||||
|  *   have user name or id in session. Default value: visitor_from_request | ||||
|  | ||||
| @ -144,6 +144,7 @@ function print_pending_threads($since) { | ||||
| 
 | ||||
| $since = verifyparam( "since", "/^\d{1,9}$/", 0); | ||||
| 
 | ||||
| loadsettings(); | ||||
| print_pending_threads($since); | ||||
| notify_operator_alive($operator['operatorid']); | ||||
| exit; | ||||
|  | ||||
| @ -74,7 +74,8 @@ if( $act == "refresh" ) { | ||||
| 
 | ||||
| } else if( $act == "rename" ) { | ||||
| 
 | ||||
| 	if( !$user_can_change_name ) { | ||||
| 	loadsettings(); | ||||
| 	if( $settings['usercanchangename'] != "1" ) { | ||||
| 		show_error("server: forbidden to change name"); | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user