add code to convert the human readable config entry ZM_SERVER_NAME into ZM_SERVER_ID

pull/1088/head
Isaac Connor 2015-07-09 11:45:19 -04:00
parent b12d72c68f
commit 69e1fd8b18
1 changed files with 11 additions and 0 deletions

View File

@ -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 );
}
}
?>