Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-10-19-19-40-00
[civicrm-core.git] / CRM / Core / BAO / CMSUser.php
index 47df55188a0f51998126007c79abb8f364b6aa7f..bd6233e88657aacc102a0f37c2db9420ac8f622f 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
  */
 
 /**
- *  this file contains functions for synchronizing cms users with CiviCRM contacts
+ * This file contains functions for synchronizing cms users with CiviCRM contacts.
  */
 
 require_once 'DB.php';
@@ -52,12 +50,8 @@ class CRM_Core_BAO_CMSUser {
    *   This behavior is misplaced in the BAO layer, but we'll preserve it to avoid
    *   contract changes in the middle of the support cycle. In the next major
    *   release, we should remove & document it.
-   *
-   * @return void
-   *
    */
   public static function synchronize($is_interactive = TRUE) {
-    //start of schronization code
     $config = CRM_Core_Config::singleton();
 
     // Build an array of rows from UF users table.
@@ -94,7 +88,9 @@ class CRM_Core_BAO_CMSUser {
       CRM_Core_Error::fatal('CMS user creation not supported for this framework');
     }
 
-    set_time_limit(300);
+    if (PHP_SAPI != 'cli') {
+      set_time_limit(300);
+    }
 
     if ($config->userSystem->is_drupal == '1') {
       $user = new StdClass();