move RW setup above user get in index.php so remember_me works
This commit is contained in:
		
							
								
								
									
										11
									
								
								index.php
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								index.php
									
									
									
									
									
								
							@@ -146,7 +146,7 @@ function formatBacktraceLine($n, $line)
 | 
				
			|||||||
    return $out;
 | 
					    return $out;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function checkMirror($action_obj, $args)
 | 
					function setupRW()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $config;
 | 
					    global $config;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -161,7 +161,10 @@ function checkMirror($action_obj, $args)
 | 
				
			|||||||
    foreach ($alwaysRW as $table) {
 | 
					    foreach ($alwaysRW as $table) {
 | 
				
			||||||
        $config['db']['table_'.$table] = 'rw';
 | 
					        $config['db']['table_'.$table] = 'rw';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function checkMirror($action_obj, $args)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
    if (common_config('db', 'mirror') && $action_obj->isReadOnly($args)) {
 | 
					    if (common_config('db', 'mirror') && $action_obj->isReadOnly($args)) {
 | 
				
			||||||
        if (is_array(common_config('db', 'mirror'))) {
 | 
					        if (is_array(common_config('db', 'mirror'))) {
 | 
				
			||||||
            // "load balancing", ha ha
 | 
					            // "load balancing", ha ha
 | 
				
			||||||
@@ -237,9 +240,13 @@ function main()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError');
 | 
					    PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Make sure RW database is setup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    setupRW();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // XXX: we need a little more structure in this script
 | 
					    // XXX: we need a little more structure in this script
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // get and cache current user
 | 
					    // get and cache current user (may hit RW!)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $user = common_current_user();
 | 
					    $user = common_current_user();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user