Skip to content

Instantly share code, notes, and snippets.

View joebordes's full-sized avatar

Joe Bordes joebordes

View GitHub Profile
@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
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 / 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"}
@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 / RestrictedAccessFromIP.diff
Created March 7, 2017 07:12
Add access IP on Restricted access message
diff --git a/modules/Users/Users.php b/modules/Users/Users.php
index c0416f6..7ab9e57 100644
--- a/modules/Users/Users.php
+++ b/modules/Users/Users.php
@@ -336,7 +336,7 @@ class Users extends CRMEntity {
if (!in_array($the_ip,$user_ip_addresses)) {
$row['status'] = 'Inactive';
$this->authenticated = false;
- coreBOS_Session::set('login_error', getTranslatedString('ERR_INVALID_USERIPLOGIN','Users'));
+ coreBOS_Session::set('login_error', getTranslatedString('ERR_INVALID_USERIPLOGIN','Users').' ('.$the_ip.')');
@joebordes
joebordes / notes.md
Last active August 28, 2019 18:40
coreBOS: Create PBXManager call via Webservice

This gist shows an example of coreBOS webservice call to create a PBXManager or Asterisk Integration call record.

The code attached to this gist was created using coreBOS Webservice Development Tool

It uses the coreBOS Webservice PHP Library

It omits the login steps

For this to work correctly you must be using a coreBOS version after February 23 2017

@joebordes
joebordes / validate_noquoteinaccountname.diff
Created February 13, 2017 22:35
Validation: Quote in account name not permitted
diff --git a/modules/Accounts/AccountsValidation.php b/modules/Accounts/AccountsValidation.php
index edc6a9f..7377ebb 100644
--- a/modules/Accounts/AccountsValidation.php
+++ b/modules/Accounts/AccountsValidation.php
@@ -44,4 +44,8 @@ if ($blockDuplicateAccounts and isset($screen_values['accountname'])) {
die;
}
}
+if (isset($screen_values['accountname']) and strpos($screen_values['accountname'], '"')!==false) {
+ echo "Sorry, but quotes are not permitted in the account name.";
@joebordes
joebordes / cbmc_noupdate_onempty.diff
Created February 7, 2017 17:48
coreBOS protect mailchimp update on empty email
commit 716e75e6f17be7792310c8b8d748e2484600167d
Author: Omar Llorens <[email protected]>
Date: Tue Feb 7 08:48:42 2017 +0100
fix(Mailchimp) protect account, contacts and leads when to not update them with empty names
diff --git a/modules/Mailchimp/webhooks.class.php b/modules/Mailchimp/webhooks.class.php
index 91d3370..c29c6c4 100644
--- a/modules/Mailchimp/webhooks.class.php
+++ b/modules/Mailchimp/webhooks.class.php
--- vaadin-combo-box-overlay.html
+++ bower_components/vaadin-combo-box/vaadin-combo-box-overlay.html
@@ -22,7 +22,7 @@
* iron-overlay-manager.html: Polymer.IronOverlayManagerClass.prototype._applyOverlayZ
*/
z-index: 200;
- overflow: hidden;
+ overflow: visible;
}
@joebordes
joebordes / WebserviceDefineExpireTime.diff
Created December 19, 2016 14:46
Patch to permit defining the webservice expire time when authenticating
diff --git a/build/RESTexpiretimeparameter.sql b/build/RESTexpiretimeparameter.sql
new file mode 100644
index 0000000..dcf58de
--- /dev/null
+++ b/build/RESTexpiretimeparameter.sql
@@ -0,0 +1 @@
+INSERT INTO `vtiger_ws_operation_parameters`(`operationid`, `name`, `type`, `sequence`) VALUES ((SELECT `operationid` FROM `vtiger_ws_operation` WHERE `name`='getchallenge'),'exptime','string',2)
diff --git a/include/Webservices/AuthToken.php b/include/Webservices/AuthToken.php
index 7779348..f73c72e 100644
--- a/include/Webservices/AuthToken.php