Location: PHPKode > projects > O - OpenSource GroupWare > osgw/admin/service_install.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/

include("./data.php");
$service['add_header'] = FALSE;
include("../config.inc.php");

include($here. "/class.admin.php");
$admin = new admin;

$location = $_GET['sv'];
	
include($O->dir ."/$location/data.php");

//Add service to database
$sql = "INSERT INTO o_services (code,location,sort_order,active, version) VALUES
	('{$service['code']}','$location','{$service['sort']}','1','{$service['version']}')";
$db->query($sql);

//Add default user rights for service (by default there's no access (0))
$sql = "INSERT INTO o_user_rights (user_id, service, rights) 
	VALUES ('1','{$service['code']}','0')";
$db->query($sql);
$service_location[] = $d;	

$handle = opendir($O->dir ."/$location/config/tables");
while (false !== ($file = readdir($handle))) 
{
	//Have to unset $fields to keep O from trying to add columns from previous tables
	//to the current table
	unset($fields);
	unset($table_name);

	if(is_file($O->dir ."/$location/config/tables/$file") && $file != '.' &&  $file != '..' && !strstr($file, '~'))
	{
		include($root_dir ."/$location/config/tables/$file");
		$sql = $db->create_table($table_name, $fields);
		$db->query($sql);
	}
		
}

header("Location:/config/upgrade_languages.php?pl=TRUE&service=$location");
Return current item: O - OpenSource GroupWare