Example #1
0
function vtws_extendSession()
{
    global $adb, $API_VERSION, $application_unique_key;
    if (isset($_SESSION["authenticated_user_id"]) && $_SESSION["app_unique_key"] == $application_unique_key) {
        $userId = $_SESSION["authenticated_user_id"];
        $sessionManager = new SessionManager();
        $sessionManager->set("authenticatedUserId", $userId);
        $crmObject = VtigerWebserviceObject::fromName($adb, "Users");
        $userId = vtws_getId($crmObject->getEntityId(), $userId);
        $vtigerVersion = vtws_getVtigerVersion();
        $resp = array("sessionName" => $sessionManager->getSessionId(), "userId" => $userId, "version" => $API_VERSION, "vtigerVersion" => $vtigerVersion);
        return $resp;
    } else {
        throw new WebServiceException(WebServiceErrorCode::$AUTHFAILURE, "Authencation Failed");
    }
}
 function runOperation($params, $user)
 {
     global $API_VERSION;
     try {
         $operation = strtolower($this->operationName);
         if (!$this->preLogin) {
             $params[] = $user;
             return call_user_func_array($this->handlerMethod, $params);
         } else {
             $userDetails = call_user_func_array($this->handlerMethod, $params);
             if (is_array($userDetails)) {
                 return $userDetails;
             } else {
                 $this->sessionManager->set("authenticatedUserId", $userDetails->id);
                 global $adb;
                 $webserviceObject = VtigerWebserviceObject::fromName($adb, "Users");
                 $userId = vtws_getId($webserviceObject->getEntityId(), $userDetails->id);
                 $vtigerVersion = vtws_getVtigerVersion();
                 $resp = array("sessionName" => $this->sessionManager->getSessionId(), "userId" => $userId, "version" => $API_VERSION, "vtigerVersion" => $vtigerVersion);
                 return $resp;
             }
         }
     } catch (WebServiceException $e) {
         throw $e;
     } catch (Exception $e) {
         throw new WebServiceException(WebServiceErrorCode::$INTERNALERROR, "Unknown Error while processing request");
     }
 }
{
    echo '<tr width="100%"><td colspan=3>' . $msg . '</td></tr>';
}
function deleteWorkflow($wfid)
{
    ExecuteQuery("DELETE FROM com_vtiger_workflowtasks WHERE workflow_id = {$wfid}");
    ExecuteQuery("DELETE FROM com_vtiger_workflows WHERE workflow_id = {$wfid}");
}
echo "<table width=80% align=center border=1>";
$force = isset($_REQUEST['force']) ? 1 : 0;
$cver = vtws_getVtigerVersion();
if ($cver == '6.1.0' or $force) {
    putMsg('<h2>** Starting Migration from 6.1 **</h2>');
    include 'build/migrate6/migrate_from_vt61.php';
}
$cver = vtws_getVtigerVersion();
if ($cver == '6.0.0' or $force) {
    putMsg('<h2>** Starting Migration from 6.0 **</h2>');
    include 'build/migrate6/migrate_from_vt60.php';
}
ExecuteQuery("DELETE FROM vtiger_def_org_share WHERE vtiger_def_org_share.tabid not in (select tabid from vtiger_tab)");
ExecuteQuery("update vtiger_users set theme='softed'");
ExecuteQuery("update vtiger_version set old_version='5.4.0', current_version='5.5.0' where id=1");
ExecuteQuery("DELETE FROM vtiger_field WHERE tablename = 'vtiger_inventoryproductrel'");
// Recalculate permissions  RecalculateSharingRules
RecalculateSharingRules();
?>
</table>
<br /><br />
<b style="color:#FF0000">Failed Queries Log</b>
<div id="failedLog" style="border:1px solid #666666;width:90%;position:relative;height:200px;overflow:auto;left:5%;top:10px;">