本文整理汇总了PHP中SugarApplication类的典型用法代码示例。如果您正苦于以下问题:PHP SugarApplication类的具体用法?PHP SugarApplication怎么用?PHP SugarApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SugarApplication类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: process
/**
* @see SugarView::process()
*/
public function process()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die("Unauthorized access to administration.");
}
// Check if the theme is valid
if (!isset($_REQUEST['theme']) || !in_array($_REQUEST['theme'], array_keys(SugarThemeRegistry::allThemes()))) {
sugar_die("theme is invalid.");
}
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save') {
$theme_config = SugarThemeRegistry::getThemeConfig($_REQUEST['theme']);
$configurator = new Configurator();
foreach ($theme_config as $name => $def) {
if (isset($_REQUEST[$name])) {
if ($_REQUEST[$name] == 'true') {
$_REQUEST[$name] = true;
} else {
if ($_REQUEST[$name] == 'false') {
$_REQUEST[$name] = false;
}
}
$configurator->config['theme_settings'][$_REQUEST['theme']][$name] = $_REQUEST[$name];
}
}
$configurator->handleOverride();
SugarApplication::redirect('index.php?module=Administration&action=ThemeSettings');
exit;
}
parent::process();
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:34,代码来源:view.themeconfigsettings.php
示例2: action_optimise
function action_optimise()
{
set_time_limit(6000);
$index = BeanFactory::getBean("AOD_Index")->getIndex();
$index->optimise();
SugarApplication::redirect('index.php?module=AOD_Index');
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:7,代码来源:controller.php
示例3: oauthLogin
/**
* OAuth Login
*
* @return bool Success or failure
*/
public function oauthLogin()
{
global $sugar_config;
$apiKey = $this->getConnector()->getProperty('oauth_consumer_key');
if (!isset($_REQUEST['code'])) {
$callback = $sugar_config['site_url'] . '/index.php?module=EAPM&action=oauth&record=' . $this->eapmBean->id;
$callback = $this->formatCallbackURL($callback);
$queryData = array('client_id' => $apiKey, 'redirect_uri' => $callback);
SugarApplication::redirect($this->getOauthAuthURL() . '?' . http_build_query($queryData));
} else {
$code = $_REQUEST['code'];
$queryData = array('grant_type' => 'authorization_code', 'code' => $code, 'client_id' => $apiKey);
$accReq = $this->getOauthAccessURL() . '?' . http_build_query($queryData);
$rawResponse = $this->makeRequest($accReq);
if ($rawResponse && $rawResponse->isSuccessful()) {
$response = json_decode($rawResponse->getBody(), true);
if (!empty($response['access_token'])) {
$this->eapmBean->oauth_token = $response['access_token'];
$this->eapmBean->validated = 1;
$this->eapmBean->save();
return true;
}
}
return false;
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:ExtAPIGoToMeeting.php
示例4: logout
public function logout()
{
session_destroy();
ob_clean();
$this->box->deleteSession();
SugarApplication::redirect($this->box->loginUrl());
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:7,代码来源:SummerAuthenticate.php
示例5: action_archived
function action_archived()
{
$this->bean->archived = 'true';
$this->bean->won = '';
$this->bean->save();
SugarApplication::redirect('index.php?module=TILKEE_TILKS&action=DetailView&record=' . $this->bean->id);
}
开发者ID:NeoArno,项目名称:tilkee-sugarcrm,代码行数:7,代码来源:controller.php
示例6: pre_login
/**
* pre_login
*
* Override the pre_login function from SugarAuthenticate so that user is
* redirected to SAML entry point if other is not specified
*/
function pre_login()
{
parent::pre_login();
if (empty($_REQUEST['no_saml'])) {
SugarApplication::redirect('?entryPoint=SAML');
}
}
开发者ID:omusico,项目名称:sugar_work,代码行数:13,代码来源:SAMLAuthenticate.php
示例7: save
public function save(&$bean, $params, $field, $vardef, $prefix = '')
{
$fakeDisplayParams = array();
$this->fillInOptions($vardef, $fakeDisplayParams);
require_once 'include/upload_file.php';
$upload_file = new UploadFile($prefix . $field . '_file');
//remove file
if (isset($_REQUEST['remove_file_' . $field]) && $params['remove_file_' . $field] == 1) {
$upload_file->unlink_file($bean->{$field});
$bean->{$field} = "";
}
$move = false;
if (isset($_FILES[$prefix . $field . '_file']) && $upload_file->confirm_upload()) {
if ($this->verify_image($upload_file)) {
$bean->{$field} = $upload_file->get_stored_file_name();
$move = true;
} else {
//not valid image.
$GLOBALS['log']->fatal("Image Field : Not a Valid Image.");
$temp = $vardef['vname'];
$temp = translate($temp, $bean->module_name);
SugarApplication::appendErrorMessage($temp . " Field : Not a valid image format.");
}
}
if (empty($bean->id)) {
$bean->id = create_guid();
$bean->new_with_id = true;
}
if ($move) {
$upload_file->final_move($bean->id . '_' . $field);
//BEAN ID IS THE FILE NAME IN THE INSTANCE.
$upload_file->upload_doc($bean, $bean->id, $params[$prefix . $vardef['docType']], $bean->{$field}, $upload_file->mime_type);
} else {
if (!empty($old_id)) {
// It's a duplicate, I think
if (empty($params[$prefix . $vardef['docUrl']])) {
$upload_file->duplicate_file($old_id, $bean->id, $bean->{$field});
} else {
$docType = $vardef['docType'];
$bean->{$docType} = $params[$prefix . $field . '_old_doctype'];
}
} else {
if (!empty($params[$prefix . $field . '_remoteName'])) {
// We aren't moving, we might need to do some remote linking
$displayParams = array();
$this->fillInOptions($vardef, $displayParams);
if (isset($params[$prefix . $vardef['docId']]) && !empty($params[$prefix . $vardef['docId']]) && isset($params[$prefix . $vardef['docType']]) && !empty($params[$prefix . $vardef['docType']])) {
$bean->{$field} = $params[$prefix . $field . '_remoteName'];
require_once 'include/utils/file_utils.php';
$extension = get_file_extension($bean->{$field});
if (!empty($extension)) {
$bean->file_ext = $extension;
$bean->file_mime_type = get_mime_content_type_from_filename($bean->{$field});
}
}
}
}
}
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:59,代码来源:SugarFieldImage.php
示例8: preDisplay
public function preDisplay()
{
?>
<link rel="stylesheet" href="modules/Nexmo/views/style.css" /><?php
if (isset($this->view_object_map['val_error'])) {
SugarApplication::appendErrorMessage($this->view_object_map['val_error']);
}
}
开发者ID:neeraj-advaiya,项目名称:SugarCRM-NexmoAlert,代码行数:8,代码来源:view.config.php
示例9: action_desarchived
function action_desarchived()
{
//$this->bean->status = 'activated';
//$this->bean->won = '';
//$this->bean->save();
$this->bean->update_from_API('', 'false');
SugarApplication::redirect('index.php?module=TILKEE_PROJECTS&action=DetailView&record=' . $this->bean->id);
}
开发者ID:NeoArno,项目名称:tilkee-sugarcrm,代码行数:8,代码来源:controller.php
示例10: preDisplay
public function preDisplay()
{
if (!$GLOBALS['current_user']->isAdminForModule('Users')) {
//instead of just dying here with unauthorized access will send the user back to his/her settings
SugarApplication::redirect('index.php?module=Users&action=DetailView&record=' . $GLOBALS['current_user']->id);
}
$this->lv = new ListViewSmarty();
$this->lv->delete = false;
$this->lv->email = false;
}
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:10,代码来源:view.list.php
示例11: display
/**
* @see SugarView::display()
*/
public function display()
{
if (isset($_FILES['vcard']['tmp_name']) && isset($_FILES['vcard']['size']) > 0) {
$vcard = new vCard();
$record = $vcard->importVCard($_FILES['vcard']['tmp_name'], $_REQUEST['module']);
SugarApplication::redirect("index.php?action=DetailView&module={$_REQUEST['module']}&record={$record}");
} else {
SugarApplication::redirect("index.php?action=Importvcard&module={$_REQUEST['module']}");
}
}
开发者ID:klr2003,项目名称:sourceread,代码行数:13,代码来源:view.importvcardsave.php
示例12: action_generatePdfJava
function action_generatePdfJava()
{
global $mod_string;
$id = $_REQUEST['uid'];
$templateID = $_REQUEST['templateID'];
$path = "/var/www/vhosts/portadainmobiliaria.iatech.com.co/httpdocs/crm/custom/modules/AOS_Contracts/ReportGenerator.jar";
$command = "/usr/bin/java -Djava.awt.headless=true -jar {$path} {$id} {$templateID}";
exec($command, $output);
$this->printRequest($_REQUEST, $path, $id, $templateID, $output, $command);
//SugarApplication::redirect('index.php?entryPoint=download&id='.$id.'&type=Notes');
SugarApplication::redirect('index.php?module=AOS_Contracts&action=DetailView&record=' . $id . '#history');
}
开发者ID:ekutor,项目名称:temis,代码行数:12,代码来源:controller.php
示例13: display
public function display()
{
if (!SugarOAuthServer::enabled()) {
sugar_die($GLOBALS['mod_strings']['LBL_OAUTH_DISABLED']);
}
global $current_user;
if (!isset($_REQUEST['token']) && isset($_REQUEST['oauth_token'])) {
$_REQUEST['token'] = $_REQUEST['oauth_token'];
}
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('APP', $GLOBALS['app_strings']);
$sugar_smarty->assign('MOD', $GLOBALS['mod_strings']);
$sugar_smarty->assign('token', $_REQUEST['token']);
$sugar_smarty->assign('sid', session_id());
$token = OAuthToken::load($_REQUEST['token']);
if (empty($token) || empty($token->consumer) || $token->tstate != OAuthToken::REQUEST || empty($token->consumer_obj)) {
sugar_die('Invalid token');
}
if (empty($_REQUEST['confirm'])) {
$sugar_smarty->assign('consumer', sprintf($GLOBALS['mod_strings']['LBL_OAUTH_CONSUMERREQ'], $token->consumer_obj->name));
// SM: roles disabled for now
// $roles = array('' => '');
// $allroles = ACLRole::getAllRoles();
// foreach($allroles as $role) {
// $roles[$role->id] = $role->name;
// }
// $sugar_smarty->assign('roles', $roles);
$hash = md5(rand());
$_SESSION['oauth_hash'] = $hash;
$sugar_smarty->assign('hash', $hash);
echo $sugar_smarty->fetch('modules/OAuthTokens/tpl/authorize.tpl');
} else {
if ($_REQUEST['sid'] != session_id() || $_SESSION['oauth_hash'] != $_REQUEST['hash']) {
sugar_die('Invalid request');
}
$verify = $token->authorize(array("user" => $current_user->id));
if (!empty($token->callback_url)) {
$redirect_url = $token->callback_url;
if (strchr($redirect_url, "?") !== false) {
$redirect_url .= '&';
} else {
$redirect_url .= '?';
}
$redirect_url .= "oauth_verifier=" . $verify . '&oauth_token=' . $_REQUEST['token'];
SugarApplication::redirect($redirect_url);
}
$sugar_smarty->assign('VERIFY', $verify);
$sugar_smarty->assign('token', '');
echo $sugar_smarty->fetch('modules/OAuthTokens/tpl/authorized.tpl');
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:51,代码来源:view.authorize.php
示例14: action_delete
protected function action_delete()
{
if ($_REQUEST['record'] != $GLOBALS['current_user']->id && $GLOBALS['current_user']->isAdminForModule('Users')) {
$u = new User();
$u->retrieve($_REQUEST['record']);
$u->deleted = 1;
$u->status = 'Inactive';
$u->employee_status = 'Terminated';
$u->save();
$GLOBALS['log']->info("User id: {$GLOBALS['current_user']->id} deleted user record: {$_REQUEST['record']}");
SugarApplication::redirect("index.php?module=Employees&action=index");
} else {
sugar_die("Unauthorized access to administration.");
}
}
开发者ID:omusico,项目名称:sugar_work,代码行数:15,代码来源:controller.php
示例15: action_log_autonote
public function action_log_autonote()
{
//Load a notes bean
$notes_bean = BeanFactory::getBean("Notes");
//Create a new note and save it
$notes_bean->name = "Leads autonote";
$notes_bean->description = "This note is autologged for a lead.";
$note_id = $notes_bean->save();
//Load leads-notes relationship
$lead_bean = BeanFactory::getBean("Leads", $_REQUEST["record"]);
$lead_bean->load_relationship("notes");
//Save relationship record
$lead_bean->notes->add($note_id);
$lead_bean->save();
SugarApplication::redirect('index.php?module=Leads&action=DetailView&record=' . $_REQUEST["record"]);
}
开发者ID:mihir-parikh,项目名称:sugarcrm_playground,代码行数:16,代码来源:controller.php
示例16: action_schedule_followup
public function action_schedule_followup()
{
//Create a new Calls bean
$calls_bean = BeanFactory::getBean("Calls");
$calls_bean->name = "A followup call";
$calls_bean->direction = "Outbound";
$calls_bean->status = "Planned";
$unix_timestamp = strtotime("+7 day");
$datetime = date("Y-m-d H:i:s", $unix_timestamp);
$calls_bean->date_start = $datetime;
$calls_bean->duration_hours = 0;
$calls_bean->duration_minutes = 30;
$calls_bean->save();
//Create a relationship
$this->bean->load_relationship("calls");
$this->bean->calls->add($calls_bean->id);
SugarApplication::redirect("index.php?module=Contacts&action=DetailView&record=" . $this->bean->id);
}
开发者ID:mihir-parikh,项目名称:sugarcrm_playground,代码行数:18,代码来源:controller.php
示例17: pre_save
public function pre_save()
{
parent::pre_save();
$this->api = ExternalAPIFactory::loadAPI($this->bean->application, true);
if (empty($this->api)) {
return $this->failed(translate('LBL_AUTH_UNSUPPORTED', $this->bean->module_dir));
}
if (empty($this->bean->id)) {
$eapmBean = EAPM::getLoginInfo($this->bean->application, true);
if ($eapmBean) {
SugarApplication::appendErrorMessage(translate('LBL_APPLICATION_FOUND_NOTICE', $this->bean->module_dir));
$this->bean->id = $eapmBean->id;
}
}
$this->bean->validated = false;
$this->bean->save_cleanup();
$this->api->loadEAPM($this->bean);
}
开发者ID:omusico,项目名称:sugar_work,代码行数:18,代码来源:controller.php
示例18: action_delete
protected function action_delete()
{
if ($_REQUEST['record'] != $GLOBALS['current_user']->id && $GLOBALS['current_user']->isAdminForModule('Users')) {
$u = new User();
$u->retrieve($_REQUEST['record']);
$u->status = 'Inactive';
$u->employee_status = 'Terminated';
$u->save();
$u->mark_deleted($u->id);
$GLOBALS['log']->info("User id: {$GLOBALS['current_user']->id} deleted user record: {$_REQUEST['record']}");
$eapm = loadBean('EAPM');
$eapm->delete_user_accounts($_REQUEST['record']);
$GLOBALS['log']->info("Removing user's External Accounts");
SugarApplication::redirect("index.php?module=Users&action=index");
} else {
sugar_die("Unauthorized access to administration.");
}
}
开发者ID:pherm,项目名称:suitecrm-bare,代码行数:18,代码来源:controller.php
示例19: action_sudo_logout_user
/**
* Written by: Hatim Alam
* Dated: 11th Feb 2016
* Controller action to logout temporary user and login back the original user
*/
protected function action_sudo_logout_user()
{
//check if current user id is same as record id
if (!empty($_REQUEST) && isset($_REQUEST['record']) && $_REQUEST['module'] == 'Users') {
$requested_user_id = $_REQUEST['record'];
if ($GLOBALS['current_user']->id == $requested_user_id && !empty($_SESSION['original_sudo_user_id'])) {
$original_user_bean = BeanFactory::getBean('Users', $_SESSION['original_sudo_user_id']);
$GLOBALS['current_user'] = $original_user_bean;
$_SESSION['authenticated_user_id'] = $original_user_bean->id;
$_SESSION['user_id'] = $original_user_bean->id;
//unset session variables
unset($_SESSION['original_sudo_user_id']);
unset($_SESSION['original_sudo_user_name']);
//redirect to original sudo user profile
$query_params = array('module' => 'Users', 'action' => 'DetailView', 'record' => $original_user_bean->id);
SugarApplication::redirect('index.php?' . http_build_query($query_params));
}
}
}
开发者ID:hatimalam,项目名称:sugarcrm-sudo-login,代码行数:24,代码来源:controller.php
示例20: action_delete
protected function action_delete()
{
if ($_REQUEST['record'] != $GLOBALS['current_user']->id && $GLOBALS['current_user']->isAdminForModule('Users')) {
$u = BeanFactory::getBean('Users', $_REQUEST['record']);
$u->deleted = 1;
$u->status = 'Inactive';
$u->employee_status = 'Terminated';
$u->save();
$GLOBALS['log']->info("User id: {$GLOBALS['current_user']->id} deleted user record: {$_REQUEST['record']}");
if (!empty($u->user_name)) {
//If user redirect back to assignment screen.
SugarApplication::redirect("index.php?module=Users&action=reassignUserRecords&record={$u->id}");
} else {
SugarApplication::redirect("index.php?module=Employees&action=index");
}
} else {
sugar_die("Unauthorized access to administration.");
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:19,代码来源:controller.php
注:本文中的SugarApplication类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论