Skip to content

Commit

Permalink
cbSR/doc(Users) quotes and function headers
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed Oct 31, 2021
1 parent 6821121 commit cf14198
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 59 deletions.
10 changes: 5 additions & 5 deletions index.php
Expand Up @@ -131,9 +131,9 @@
}

// Prevent loading Login again if there is an authenticated user in the session.
if (isset($_SESSION["authenticated_user_id"]) && isset($module) && $module == 'Users' && $action == 'Login') {
$default_action = GlobalVariable::getVariable('Application_Default_Action', 'index', 'Home', $_SESSION["authenticated_user_id"]);
$default_module = GlobalVariable::getVariable('Application_Default_Module', 'Home', 'Home', $_SESSION["authenticated_user_id"]);
if (isset($_SESSION['authenticated_user_id']) && isset($module) && $module == 'Users' && $action == 'Login') {
$default_action = GlobalVariable::getVariable('Application_Default_Action', 'index', 'Home', $_SESSION['authenticated_user_id']);
$default_module = GlobalVariable::getVariable('Application_Default_Module', 'Home', 'Home', $_SESSION['authenticated_user_id']);
$result = $adb->pquery('select tabid from vtiger_tab where name=?', array($default_module));
if (!$result || $adb->num_rows($result)==0) {
$default_module = 'Home';
Expand All @@ -144,15 +144,15 @@
if ($use_current_login) {
//getting the internal_mailer flag
if (!isset($_SESSION['internal_mailer'])) {
$qry_res = $adb->pquery("select internal_mailer from vtiger_users where id=?", array($_SESSION["authenticated_user_id"]));
$qry_res = $adb->pquery('select internal_mailer from vtiger_users where id=?', array($_SESSION['authenticated_user_id']));
coreBOS_Session::set('internal_mailer', $adb->query_result($qry_res, 0, 'internal_mailer'));
}
$log->debug('authenticated user: '.$_SESSION['authenticated_user_id']);
if (coreBOS_Settings::getSetting('cbSMActive', 0) && !is_adminID($_SESSION['authenticated_user_id'])) {
include 'modules/Vtiger/maintenance.php';
exit;
}
} elseif (isset($action) && isset($module) && $action=="Authenticate" && $module=="Users") {
} elseif (isset($action) && isset($module) && $action=='Authenticate' && $module=='Users') {
$log->debug('authenticating user');
} else {
if (!isset($_REQUEST['action']) || ($_REQUEST['action'] != 'Logout' && $_REQUEST['action'] != 'Login')) {
Expand Down
34 changes: 17 additions & 17 deletions modules/Users/CreateUserPrivilegeFile.php
Expand Up @@ -16,15 +16,15 @@

/** Creates a file with all the user, user-role,user-profile, user-groups informations
* @param $userid -- user id:: Type integer
* @returns user_privileges_userid file under the user_privileges directory
* @return user_privileges_userid file under the user_privileges directory
*/
function createUserPrivilegesfile($userid) {
global $root_directory;
$userid = preg_replace('/[^0-9]/', '', $userid);
if (empty($userid)) {
return false;
}
$handle=@fopen($root_directory.'user_privileges/user_privileges_'.$userid.'.php', "w+");
$handle=@fopen($root_directory.'user_privileges/user_privileges_'.$userid.'.php', 'w+');

if ($handle) {
$newbuf='';
Expand All @@ -45,9 +45,9 @@ function createUserPrivilegesfile($userid) {
if ($user_focus->is_admin == 'on') {
$newbuf .= "\$is_admin=true;\n";
$newbuf .="\n";
$newbuf .= "\$user_info=".constructSingleStringKeyValueArray($userInfo).";\n";
$newbuf .= '$user_info='.constructSingleStringKeyValueArray($userInfo).";\n";
$newbuf .= "\n";
$newbuf .= "?>";
$newbuf .= '?>';
} else {
$newbuf .= "\$is_admin=false;\n";
$newbuf .= "\n";
Expand Down Expand Up @@ -106,7 +106,7 @@ function createUserSharingPrivilegesfile($userid) {
}
checkFileAccessForInclusion('user_privileges/user_privileges_'.$userid.'.php');
require 'user_privileges/user_privileges_'.$userid.'.php';
$handle=@fopen($root_directory.'user_privileges/sharing_privileges_'.$userid.'.php', "w+");
$handle=@fopen($root_directory.'user_privileges/sharing_privileges_'.$userid.'.php', 'w+');

if ($handle) {
$newbuf='';
Expand Down Expand Up @@ -852,7 +852,7 @@ function getUserModuleSharingObjects($module, $userid, $def_org_share, $current_
* @param $mod_sharingrule_members -- Sharing Rule Members array:: Type array
* @param $$mod_share_read_per -- Sharing Module Read Permission array:: Type array
* @param $$mod_share_write_per -- Sharing Module Write Permission array:: Type array
* @returns $related_mod_sharing_permission; -- array which contains the id of roles,group and users related module data to be shared
* @return $related_mod_sharing_permission; -- array which contains the id of roles,group and users related module data to be shared
*/
function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share) {
global $adb;
Expand Down Expand Up @@ -989,7 +989,7 @@ function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_mem

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructArray($var) {
if (is_array($var)) {
Expand All @@ -1004,7 +1004,7 @@ function constructArray($var) {

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructSingleStringValueArray($var) {
$size = count($var);
Expand All @@ -1026,7 +1026,7 @@ function constructSingleStringValueArray($var) {

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructSingleStringKeyAndValueArray($var) {
$size = count($var);
Expand All @@ -1048,7 +1048,7 @@ function constructSingleStringKeyAndValueArray($var) {

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructSingleStringKeyValueArray($var) {
global $adb;
Expand All @@ -1073,7 +1073,7 @@ function constructSingleStringKeyValueArray($var) {

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructSingleArray($var) {
if (is_array($var)) {
Expand All @@ -1088,7 +1088,7 @@ function constructSingleArray($var) {

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructSingleCharArray($var) {
if (is_array($var)) {
Expand All @@ -1103,7 +1103,7 @@ function constructSingleCharArray($var) {

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructTwoDimensionalArray($var) {
if (is_array($var)) {
Expand All @@ -1122,7 +1122,7 @@ function constructTwoDimensionalArray($var) {

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructTwoDimensionalValueArray($var) {
if (is_array($var)) {
Expand All @@ -1141,7 +1141,7 @@ function constructTwoDimensionalValueArray($var) {

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructTwoDimensionalCharIntSingleArray($var) {
if (is_array($var)) {
Expand All @@ -1160,7 +1160,7 @@ function constructTwoDimensionalCharIntSingleArray($var) {

/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
* @return $code -- contains the whole array in a single string:: Type array
*/
function constructTwoDimensionalCharIntSingleValueArray($var) {
if (is_array($var)) {
Expand Down Expand Up @@ -1346,7 +1346,7 @@ function populateRelatedSharingPrivileges($enttype, $userid, $module, $relmodule
}
$user_arr=array();
if (count($var_name_arr['ROLE']) > 0) {
$query="insert into ".$table_name." values ";
$query="insert into $table_name values ";
$has_values = false;
foreach ($var_name_arr['ROLE'] as $roleusers) {
foreach ($roleusers as $user_id) {
Expand Down

0 comments on commit cf14198

Please sign in to comment.