[smoothoperator] r4209 committed - Start providing ability to serve multi tenant settings

8 views
Skip to first unread message

smootho...@googlecode.com

unread,
Jan 7, 2014, 9:17:17 PM1/7/14
to smootho...@googlegroups.com
Revision: 4209
Author: ma...@venturevoip.com
Date: Wed Jan 8 02:16:52 2014 UTC
Log: Start providing ability to serve multi tenant settings

http://code.google.com/p/smoothoperator/source/detail?r=4209

Added:
/SmoothOperatorCRM/multi_tenant.php
Modified:
/SmoothOperatorCRM/config.php
/SmoothOperatorCRM/functions/database.php

=======================================
--- /dev/null
+++ /SmoothOperatorCRM/multi_tenant.php Wed Jan 8 02:16:52 2014 UTC
@@ -0,0 +1,8 @@
+<?
+require "header.php";
+$result = mysqli_query($connection,"SELECT * FROM
SmoothOperator.multitenant");
+while ($row = mysqli_fetch_assoc($result)) {
+ print_pre($row);
+}
+require "footer.php";
+?>
=======================================
--- /SmoothOperatorCRM/config.php Sun Jan 8 06:23:45 2012 UTC
+++ /SmoothOperatorCRM/config.php Wed Jan 8 02:16:52 2014 UTC
@@ -39,6 +39,8 @@
while ($row = mysqli_fetch_assoc($result)) {
if ($row['parameter'] == 'smoothtorque_db_pass') {
echo '<tr><th>'.$row['description'].'</th><td><input
type="password" name="'.$row['parameter'].'"
value="'.stripslashes($config_values[$row['parameter']]).'"></td></tr>';
+ } else if ($row['parameter'] == 'site_name') {
+ echo '<tr><th>Multi Tenant Names</th><td><a
href="multi_tenant.php?edit=1"><img src="images/pencil.png"> Edit Multi
Tenant Names</a></td></tr>';
} else {
echo '<tr><th>'.$row['description'].'</th><td><input type="text"
name="'.$row['parameter'].'"
value="'.stripslashes($config_values[$row['parameter']]).'"></td></tr>';
}
=======================================
--- /SmoothOperatorCRM/functions/database.php Thu Apr 11 19:40:20 2013 UTC
+++ /SmoothOperatorCRM/functions/database.php Wed Jan 8 02:16:52 2014 UTC
@@ -95,6 +95,19 @@
) ENGINE=InnoDB";
$result = mysqli_query($link, $sql);
}
+
+
/*======================================================================
+ Multi Tenant
+
======================================================================*/
+ if (!mysqli_is_table($host,$user,$pass,"SmoothOperator","multitenant")){
+ $messages[] = "MultiTenant table is missing...created";
+ $sql = "Create table `multitenant` (
+ `url` varchar(255),
+ `name` text)";
+ $result = mysqli_query($link, $sql);
+ $result = mysqli_query($link, "INSERT INTO multitenant (url,
name) VALUES ('default', 'SmoothOperator CRM')");
+ }
+

/* Create the jobs table if missing */
if (!mysqli_is_table($host, $user,
$pass,"SmoothOperator", "jobs")) {
@@ -310,7 +323,8 @@
(23,'Dialer','en',10,'dialer.php',0,0,1,-1,'phone.png'),
(24,'Disposition
Report','en',10,'report_dispositions.php',0,0,0,-1,NULL),
(25,'Agent Utilisation
Report','en',10,'report_agent_utilisation.php',0,0,0,-1,NULL),
- (26,'Contact Rate
Report','en',10,'report_contact_rate.php',0,0,0,-1,NULL)";
+ (26,'Contact Rate
Report','en',10,'report_contact_rate.php',0,0,0,-1,NULL),
+ (27,'Multi Tenant
Settings','en',10,'multi_tenant.php',0,0,0,-1,NULL)";
$result = mysqli_query($link, $sql);
}

Reply all
Reply to author
Forward
0 new messages