add code to convert the human readable config entry ZM_SERVER_NAME into ZM_SERVER_ID
parent
b12d72c68f
commit
69e1fd8b18
|
@ -166,4 +166,15 @@ function loadConfig( $defineConsts=true )
|
|||
//print_r( $configCats );
|
||||
}
|
||||
|
||||
// For Human-readability, user ZM_SERVER in zm.conf, and convert it here to a ZM_SERVER_ID
|
||||
if ( ! defined(ZM_SERVER_ID) and defined(ZM_SERVER) ) {
|
||||
$server_id = dbFetchOne('SELECT Id FROM Servers WHERE Name=?', 'Id', array(ZM_SERVER_NAME));
|
||||
if ( ! $server_id ) {
|
||||
Error("ZM_SERVER_NAME set in config, but not found in Servers table.");
|
||||
} else {
|
||||
define( ZM_SERVER_ID, $server_id );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue