Detect SuiteCRM only with global variable ['sugarcrm']
This commit is contained in:
parent
052824e4b7
commit
3249260653
6 changed files with 153 additions and 147 deletions
|
@ -16,7 +16,7 @@ REQUIREMENTS
|
|||
------------
|
||||
|
||||
**SuiteDesk** began long time ago as a Drupal 6 project, and now continues as a
|
||||
standalone software product. It requires:
|
||||
standalone open software product. It requires:
|
||||
|
||||
* A web server (Apache web server with mode_rewrite module and the ability to
|
||||
use local .htaccess files is recommended),
|
||||
|
@ -38,85 +38,161 @@ You can obtain the latest **SuiteDesk** release from:
|
|||
If you select files in `.tar.gz` or `.zip` format, they can be extracted using
|
||||
most compression tools. Example, on a typical Unix command line, use:
|
||||
|
||||
wget REPOSITORY/archive.tar.gz?ref=master
|
||||
wget REPOSITORY/archive.tar.gz?ref=version
|
||||
tar -zxvf archive.tar.gz
|
||||
|
||||
This will create a new directory `suitedesk/` containing all **SuiteDesk** files
|
||||
and directories. Move the contents of that directory into a directory within
|
||||
This will create a new directory called `suitedesk-version/` containing all
|
||||
**SuiteDesk** files and directories. Move the contents of that directory into
|
||||
your web server's document root or your public HTML directory:
|
||||
|
||||
mv suitedesk/* suitedesk/.htaccess /var/www/html
|
||||
mv suitedesk-version/* suitedesk-version/.htaccess /var/www/html
|
||||
|
||||
### 2. CREATE THE CONFIGURATION FILE AND GRANT WRITE PERMISSIONS
|
||||
### 2. DOWNLOAD PDF TOOL
|
||||
|
||||
SuiteDesk comes with a default.settings.php file in the config/default
|
||||
The print PDF module requires the use of an external PDF generation tool. The
|
||||
currently supported is *wkhtmltopdf*. To install follow the next steps:
|
||||
|
||||
1. Download *wkhtmltopdf* from https://wkhtmltopdf.org/downloads.html. You can
|
||||
choose to download the source and compile it or simply download the static
|
||||
binary, which doesn't require you to compile anything. Note that the compiled
|
||||
version may require a running X server (static uses patched libs that can
|
||||
work without one).
|
||||
2. Place the `wkhtmltopdf` executable into the `libraries` directory. You can
|
||||
also place a symbolic link to the executable.
|
||||
3. Check https://wkhtmltopdf.org/usage/wkhtmltopdf.txt for further information.
|
||||
|
||||
### 3. CREATE THE CONFIGURATION FILE AND GRANT WRITE PERMISSIONS
|
||||
|
||||
**SuiteDesk** comes with a `default.settings.php` file in the `config/default`
|
||||
directory. Use this file as a template to create your settings file. To avoid
|
||||
problems when upgrading, SuiteDesk is not packaged with an actual settings file.
|
||||
You must create a file named settings.php. You may do so by making a copy of
|
||||
default.settings.php (or create an empty file with this name in the same
|
||||
directory). For example, (from the installation directory) make a copy of the
|
||||
default.settings.php file with the command:
|
||||
problems when upgrading, **SuiteDesk** is not packaged with an actual settings
|
||||
file. You must create a file named `settings.php`. You may do so by making a
|
||||
copy of `default.settings.php`. For example (from the `config` directory):
|
||||
|
||||
cp config/default/default.settings.php config/default/settings.php
|
||||
|
||||
Next, give the web server write privileges to the config/default/settings.php
|
||||
file with the command (from the installation directory):
|
||||
Next, give the web server write privileges to the `config/default/settings.php`
|
||||
file with the command (from the `config` directory):
|
||||
|
||||
chmod o+w config/default/settings.php
|
||||
|
||||
So that the files directory can be created automatically, give the web server
|
||||
write privileges to the config/default directory with the command (from the
|
||||
installation directory):
|
||||
write privileges to the `config/default` directory with the command (from the
|
||||
`config` directory):
|
||||
|
||||
chmod o+w config/default
|
||||
|
||||
### 3. CREATE THE SUITEDESK DATABASE
|
||||
You can create more than one configuration file, and the configuration file to
|
||||
be loaded is based upon the rules below.
|
||||
|
||||
SuiteDesk requires access to a database in order to be installed. Your database
|
||||
user will need sufficient privileges to run SuiteDesk.
|
||||
The configuration directory will be discovered by stripping the website's
|
||||
hostname from left to right and pathname from right to left. The first
|
||||
configuration file found will be used and any others will be ignored. If no
|
||||
other configuration file is found then the default configuration file at
|
||||
`config/default` will be used. For example, for a fictitious site installed at
|
||||
http://www.example.org/mysite/test the `settings.php` is searched in the
|
||||
following directories:
|
||||
|
||||
1. config/www.example.org.mysite.test
|
||||
2. config/example.org.mysite.test
|
||||
3. config/org.mysite.test
|
||||
|
||||
4. config/www.example.org.mysite
|
||||
5. config/example.org.mysite
|
||||
6. config/org.mysite
|
||||
|
||||
7. config/www.example.org
|
||||
8. config/example.org
|
||||
9. config/org
|
||||
|
||||
10. config/default
|
||||
|
||||
If you are installing on a non-standard port number, prefix the hostname with
|
||||
that number. For example, http://www.example.org:8080/mysite/test could be
|
||||
loaded from `config/8080.www.drupal.org.mysite.test` directory.
|
||||
|
||||
### 4. CREATE THE SUITEDESK DATABASE
|
||||
|
||||
**SuiteDesk** requires access to a database in order to be installed. Your
|
||||
database user will need sufficient privileges to run **SuiteDesk**.
|
||||
|
||||
To create a database using PHPMyAdmin or a web-based control panel consult the
|
||||
documentation or ask your webhost service provider.
|
||||
|
||||
Take note of the username, password, database name and hostname as you create
|
||||
the database. You will enter these items in the install script.
|
||||
Take note of the *username*, *password*, *database name* and *hostname* as you
|
||||
create the database. You will enter these items in the next commands.
|
||||
|
||||
This step is only necessary if you don't already have a database set-up (e.g. by
|
||||
your host). In the following examples, 'username' is an example MySQL user which
|
||||
your host). In the following examples, *username* is an example MySQL user which
|
||||
has the CREATE and GRANT privileges. Use the appropriate user name for your
|
||||
system.
|
||||
|
||||
First, you must create a new database for your Drupal site (here, 'databasename'
|
||||
is the name of the new database):
|
||||
First, you must create a new database for your site (here, *databasename* is the
|
||||
name of the new database):
|
||||
|
||||
mysqladmin -u username -p create databasename
|
||||
mysqladmin -u username -p create databasename
|
||||
|
||||
MySQL will prompt for the 'username' database password and then create the
|
||||
initial database files. Next you must login and set the access database rights:
|
||||
MySQL will prompt for the *username* database password and then create the
|
||||
initial database files. Next you must login and set the access database rights:
|
||||
|
||||
mysql -u username -p
|
||||
mysql -u username -p
|
||||
|
||||
Again, you will be asked for the 'username' database password. At the MySQL
|
||||
prompt, enter following command:
|
||||
Again, you will be asked for the *username* database password. At the MySQL
|
||||
prompt, enter following command:
|
||||
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER,
|
||||
CREATE TEMPORARY TABLES ON databasename.*
|
||||
TO 'username'@'localhost' IDENTIFIED BY 'password';
|
||||
```sql
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER,
|
||||
CREATE TEMPORARY TABLES ON databasename.*
|
||||
TO 'username'@'localhost' IDENTIFIED BY 'password';
|
||||
```
|
||||
|
||||
where
|
||||
where
|
||||
|
||||
'databasename' is the name of your database
|
||||
'username@localhost' is the username of your MySQL account
|
||||
'password' is the password required for that username
|
||||
*databasename* is the name of your database
|
||||
*username@localhost* is the username of your MySQL account
|
||||
*password* is the password required for that username
|
||||
|
||||
Note: Unless your database user has all of the privileges listed above, you will
|
||||
not be able to run Drupal.
|
||||
Note: Unless your database user has all of the privileges listed above, you will
|
||||
not be able to run **SuiteDesk**.
|
||||
|
||||
If successful, MySQL will reply with:
|
||||
If successful, MySQL will reply with:
|
||||
|
||||
Query OK, 0 rows affected
|
||||
Query OK, 0 rows affected
|
||||
|
||||
### 4. RUN THE INSTALL SCRIPT
|
||||
In the configuration file you will fill out the `$db_url` variable to configure
|
||||
the database connection using the format:
|
||||
|
||||
$db_url['default'] = 'mysql://username:password@localhost/databasename';
|
||||
|
||||
If your *username*, *password* or *database name* contain characters used to
|
||||
delineate `$db_url` parts, you can escape them via URI hex encodings:
|
||||
|
||||
: = %3a / = %2f @ = %40
|
||||
+ = %2b ( = %28 ) = %29
|
||||
? = %3f = = %3d & = %26
|
||||
|
||||
If you prefix some or all database table names, you can use the `$db_prefix`
|
||||
setting and each table name will be prepended with its value. Be sure to use
|
||||
valid database characters only, usually alphanumeric and underscore. If no
|
||||
prefixes are desired, leave it as an empty string ''.
|
||||
|
||||
To have all database names prefixed, set `$db_prefix` as a string:
|
||||
|
||||
$db_prefix = 'main_';
|
||||
|
||||
To provide prefixes for specific tables set `$db_prefix` as an array where keys
|
||||
are the table names and the values are the prefixes. The `default` element holds
|
||||
the prefix for any tables not specified elsewhere in the array:
|
||||
|
||||
$db_prefix = array(
|
||||
'default' => 'main_',
|
||||
'users' => 'shared_',
|
||||
'sessions' => 'shared_',
|
||||
'role' => 'shared_',
|
||||
'authmap' => 'shared_',
|
||||
);
|
||||
|
||||
### 5. RUN THE INSTALL SCRIPT
|
||||
|
||||
To run the install script point your browser to the base URL of your website
|
||||
(e.g., http://www.example.com).
|
||||
|
@ -149,7 +225,7 @@ system.
|
|||
file is at config/default/settings.php, it may be in another location
|
||||
if you use the multi-site setup, as explained below.
|
||||
|
||||
### 5. CONFIGURE SUITEDESK
|
||||
### 6. CONFIGURE SUITEDESK
|
||||
|
||||
When the install script succeeds, you will be directed to the "Welcome"
|
||||
page, and you will be logged in as the administrator already. Proceed with
|
||||
|
@ -161,7 +237,7 @@ system.
|
|||
running FastCGI can run into problems if the $base_url variable is left
|
||||
commented out (see http://bugs.php.net/bug.php?id=19656).
|
||||
|
||||
### 6. REVIEW FILE SYSTEM STORAGE SETTINGS AND FILE PERMISSIONS
|
||||
### 7. REVIEW FILE SYSTEM STORAGE SETTINGS AND FILE PERMISSIONS
|
||||
|
||||
The files directory created in step 4 is the default file system path used
|
||||
to store all uploaded files, as well as some temporary files created by Drupal.
|
||||
|
@ -225,7 +301,7 @@ system.
|
|||
Windows file permissions" (http://drupal.org/node/202491) in the online
|
||||
handbook.
|
||||
|
||||
### 7. CRON MAINTENANCE TASKS
|
||||
### 8. CRON MAINTENANCE TASKS
|
||||
|
||||
Many Drupal modules have periodic tasks that must be triggered by a cron
|
||||
maintenance task, including search module (to build and update the index
|
||||
|
|
|
@ -7,88 +7,13 @@
|
|||
* This file may have been set to read-only by Drupal. If you make changes to
|
||||
* this file, be sure to protect it again after making your modifications.
|
||||
* Failure to remove write permission to this file is a security risk.
|
||||
*
|
||||
* The configuration file to be loaded is based upon the rules below.
|
||||
*
|
||||
* The configuration directory will be discovered by stripping the website's
|
||||
* hostname from left to right and pathname from right to left. The first
|
||||
* configuration file found will be used and any others will be ignored. If no
|
||||
* other configuration file is found then the default configuration file at
|
||||
* 'config/default' will be used. For example, for a fictitious site installed
|
||||
* at http://www.example.org/mysite/test the 'settings.php' is searched in the
|
||||
* following directories:
|
||||
*
|
||||
* 1. config/www.example.org.mysite.test
|
||||
* 2. config/example.org.mysite.test
|
||||
* 3. config/org.mysite.test
|
||||
*
|
||||
* 4. config/www.example.org.mysite
|
||||
* 5. config/example.org.mysite
|
||||
* 6. config/org.mysite
|
||||
*
|
||||
* 7. config/www.example.org
|
||||
* 8. config/example.org
|
||||
* 9. config/org
|
||||
*
|
||||
* 10. config/default
|
||||
*
|
||||
* If you are installing on a non-standard port number, prefix the hostname with
|
||||
* that number. For example, http://www.example.org:8080/mysite/test could be
|
||||
* loaded from config/8080.www.drupal.org.mysite.test directory.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Database settings.
|
||||
*
|
||||
* Note that the $db_url variable gets parsed using PHP's built-in URL parser
|
||||
* (i.e. using the "parse_url()" function) so make sure not to confuse the
|
||||
* parser. If your username, password or database name contain characters used
|
||||
* to delineate $db_url parts, you can escape them via URI hex encodings:
|
||||
*
|
||||
* : = %3a / = %2f @ = %40
|
||||
* + = %2b ( = %28 ) = %29
|
||||
* ? = %3f = = %3d & = %26
|
||||
*
|
||||
* To specify multiple connections to use in your site (i.e. for complex custom
|
||||
* modules) you can also specify an associative array of $db_url variables with
|
||||
* the 'default' element used until otherwise requested.
|
||||
*
|
||||
* If you prefix some or all database table names, you can use the $db_prefix
|
||||
* setting and each table name will be prepended with its value. Be sure to use
|
||||
* valid database characters only, usually alphanumeric and underscore. If no
|
||||
* prefixes are desired, leave it as an empty string ''.
|
||||
*
|
||||
* To have all database names prefixed, set $db_prefix as a string:
|
||||
*
|
||||
* $db_prefix = 'main_';
|
||||
*
|
||||
* To provide prefixes for specific tables set $db_prefix as an array where keys
|
||||
* are the table names and the values are the prefixes. The 'default' element
|
||||
* holds the prefix for any tables not specified elsewhere in the array:
|
||||
*
|
||||
* $db_prefix = array(
|
||||
* 'default' => 'main_',
|
||||
* 'users' => 'shared_',
|
||||
* 'sessions' => 'shared_',
|
||||
* 'role' => 'shared_',
|
||||
* 'authmap' => 'shared_',
|
||||
* );
|
||||
*
|
||||
* Database URL format:
|
||||
* $db_url = 'mysql://username:password@localhost/databasename';
|
||||
* $db_url = 'mysqli://username:password@localhost/databasename';
|
||||
* $db_url = 'pgsql://username:password@localhost/databasename';
|
||||
*/
|
||||
$db_url = 'mysql://username:password@localhost/databasename';
|
||||
// Database settings:
|
||||
$db_url['default'] = 'mysql://username:password@localhost/databasename';
|
||||
$db_prefix = '';
|
||||
|
||||
/**
|
||||
* SuiteCRM (a fork of SugarCRM) access.
|
||||
*
|
||||
* Don't forget to assign TRUE to this variable and uncomment to provide the
|
||||
* SuiteCRM database connection.
|
||||
*/
|
||||
$conf['storm_suitecrm'] = FALSE;
|
||||
// SuiteCRM (a fork of SugarCRM) database access:
|
||||
# $db_url['sugarcrm'] = 'mysql://username:password@localhost/databasename';
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue