Skip to content

Instantly share code, notes, and snippets.

View joebordes's full-sized avatar

Joe Bordes joebordes

View GitHub Profile
@joebordes
joebordes / accessIPOnLoginScreen.diff
Last active March 9, 2017 08:18
Add access IP message to Login screen
diff --git a/modules/Users/Login.php b/modules/Users/Login.php
index 9966bc6..d031f2d 100644
--- a/modules/Users/Login.php
+++ b/modules/Users/Login.php
@@ -58,7 +58,8 @@ else
if(isset($_SESSION["login_error"])) {
$login_error = $_SESSION['login_error'];
} else {
- $login_error = '';
+ $the_ip = Vtiger_Request::get_ip();
@joebordes
joebordes / accessIPMessageOnLogin.diff
Created March 9, 2017 08:52
accessIPMessageOnLogin
diff --git a/Smarty/templates/Login.tpl b/Smarty/templates/Login.tpl
index c2af992..ad75657 100644
--- a/Smarty/templates/Login.tpl
+++ b/Smarty/templates/Login.tpl
@@ -34,4 +34,5 @@
{/if}
</form>
</div>
+ <div class="ipWarningNotice">{$MySpecialMessage}</div>
{include file="LoginFooter.tpl"}
diff --git a/Smarty/templates/EditViewUI.tpl b/Smarty/templates/EditViewUI.tpl
index 4a1c225..dd1df67 100644
--- a/Smarty/templates/EditViewUI.tpl
+++ b/Smarty/templates/EditViewUI.tpl
@@ -307,8 +307,10 @@ alt="{'LBL_CLEAR'|@getTranslatedString}" title="{'LBL_CLEAR'|@getTranslatedStrin
<font color="red">{$mandatory_field}</font>{$usefldlabel} {if $MASS_EDIT eq '1'}<input type="checkbox" name="{$fldname}_mass_edit_check" id="{$fldname}_mass_edit_check" class="small" >{/if}
</td>
<td width="30%" align=left class="dvtCellInfo">
- <input readonly name="account_name" id = "single_accountid" type="text" value="{$fldvalue}"><input name="{$fldname}" type="hidden" value="{$secondvalue}">&nbsp;<img src="{'select.gif'|@vtiger_imageurl:$THEME}" alt="{$APP.LBL_SELECT}" title="{$APP.LBL_SELECT}" onclick='return window.open("index.php?module=Accounts&action=Popup&popuptype=specific_account_address&form=TasksEditView&form_submit=false&fromlink={$fromlink}","test","width=640,height=602,resizable=0,scrollbars=0
@joebordes
joebordes / README.md
Last active June 13, 2017 16:31
coreBOS Webservice session expire test
  • Edit both files and set the $coreBOS_Basedir, $cbURL, $cbUserName and $cbAccessKey variables
    • $coreBOS_Basedir must point to the top of the directory where the coreBOS Webservice PHP library lives
    • the coreBOS Webservice library is not used, just the classes to inteface with http through cURL
  • Launch dologin.php
  • Edit doquery and set the $cbSessionID to the value returned from dologin.php
  • Launch doquery.php as many times as you want
@joebordes
joebordes / addFooterLink.php
Last active August 4, 2017 15:49
coreBOS javascript hooks
@joebordes
joebordes / kui_autocomplete_on_leads.diff
Created June 26, 2017 23:47
coreboscrm: Get crmid from KUI company lead field on select
diff --git a/Smarty/templates/EditViewUI.tpl b/Smarty/templates/EditViewUI.tpl
index 6aa464f..4e44736 100644
--- a/Smarty/templates/EditViewUI.tpl
+++ b/Smarty/templates/EditViewUI.tpl
@@ -123,7 +123,10 @@ alt="{'LBL_CLEAR'|@getTranslatedString}" title="{'LBL_CLEAR'|@getTranslatedStrin
</td>
<td width=30% align=left class="dvtCellInfo">
<input type="text" name="{$fldname}" id="{$fldname}" tabindex="{$vt_tab}" value="{$fldvalue}" tabindex="{$vt_tab}" class=detailedViewTextBox onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'">
- {if isset($AccountContactLead_Duplicates_Hint) && $AccountContactLead_Duplicates_Hint eq 'yes'}
+ {if true}
<?php
include 'vtlib/Vtiger/Module.php';
require_once('include/events/include.inc');
global $current_user, $adb;
$current_user = Users::getActiveAdminUser();
$workflowManager = new VTWorkflowManager($adb);
$taskManager = new VTTaskManager($adb);
$calendarWorkflow = $workflowManager->newWorkFlow("cbCalendar");
@joebordes
joebordes / MissingModulePHP53.diff
Created September 15, 2017 21:52
Patch to get coreBOS working on PHP 5.3
diff --git a/index.php b/index.php
index 8aaea9b..f422c3c 100644
--- a/index.php
+++ b/index.php
@@ -118,8 +118,8 @@ $is_action = false;
if (isset($_REQUEST['module'])) {
$module = vtlib_purify($_REQUEST['module']);
if (!preg_match('/[\/.]/',$module)) {
- $dir = @scandir($root_directory.'modules', SCANDIR_SORT_NONE);
- $in_dir = @scandir($root_directory.'modules/'.$module, SCANDIR_SORT_NONE);
@joebordes
joebordes / showAppMsg.php
Created September 21, 2017 17:32
coreBOS Application Message outputs
<?php
include_once('vtlib/Vtiger/Module.php');
require_once('Smarty_setup.php');
$smarty = new vtigerCRM_Smarty();
$smarty->assign('APP', $app_strings);
$smarty->assign('ERROR_MESSAGE_CLASS', 'cb-alert-warning');
$smarty->assign('ERROR_MESSAGE', 'This is a WARNING message.');
$smarty->display('applicationmessage.tpl');
$smarty->assign('ERROR_MESSAGE_CLASS', 'cb-alert-danger');
$smarty->assign('ERROR_MESSAGE', 'This is a DANGER message.');
@joebordes
joebordes / README.md
Last active February 27, 2018 19:40
find duplicate keys in php array
  • use checkdupkey from the command line to give it file names and get back a list of the ones that have duplicate keys
  • duparraykey.php does the magic and returns 0/1 as an exit code so it can be automated on the command line
  • repeatedlabels.php does the same magic as duparraykey.php but it is prepared to show you a list of the duplicated keys in the browser.

The idea is to run checkdupkey on your arrays and use repeatedlabels.php on the positive ones in order to fix them

License: MIT

HTH