本文整理汇总了PHP中CRM_Utils_System::authenticateScript方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_System::authenticateScript方法的具体用法?PHP CRM_Utils_System::authenticateScript怎么用?PHP CRM_Utils_System::authenticateScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_System
的用法示例。
在下文中一共展示了CRM_Utils_System::authenticateScript方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
session_start();
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
require_once 'Console/Getopt.php';
$shortOptions = "n:p:k:pre";
$longOptions = array('name=', 'pass=', 'key=', 'prefix=');
$getopt = new Console_Getopt();
$args = $getopt->readPHPArgv();
array_shift($args);
list($valid, $dontCare) = $getopt->getopt2($args, $shortOptions, $longOptions);
$vars = array('name' => 'n', 'pass' => 'p', 'key' => 'k', 'prefix' => 'pre');
foreach ($vars as $var => $short) {
${$var} = NULL;
foreach ($valid as $v) {
if ($v[0] == $short || $v[0] == "--{$var}") {
${$var} = $v[1];
break;
}
}
if (!${$var}) {
${$var} = CRM_Utils_Array::value($var, $_REQUEST);
}
$_REQUEST[$var] = ${$var};
}
// this does not return on failure
// require_once 'CRM/Utils/System.php';
CRM_Utils_System::authenticateScript(TRUE, $name, $pass);
//log the execution of script
CRM_Core_Error::debug_log_message('NormalizePhone.php');
// process all phones
processPhones($config, $prefix);
}
示例2: __construct
function __construct()
{
$this->initialize();
CRM_Utils_System::authenticateScript(TRUE);
//log the execution of script
CRM_Core_Error::debug_log_message('CiviReportMail.php');
}
示例3: run
function run()
{
session_start();
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
// this does not return on failure
CRM_Utils_System::authenticateScript(true);
encryptDB();
}
示例4: sfs_bin_Utils_auth
function sfs_bin_Utils_auth()
{
session_start();
global $civicrm_root;
require_once "{$civicrm_root}/civicrm.config.php";
require_once 'CRM/Core/Config.php';
$config =& CRM_Core_Config::singleton();
// this does not return on failure
CRM_Utils_System::authenticateScript(true);
}
示例5: __construct
function __construct()
{
$config = CRM_Core_Config::singleton();
//this does not return on failure
require_once 'CRM/Utils/System.php';
require_once 'CRM/Utils/Hook.php';
CRM_Utils_System::authenticateScript(TRUE);
//log the execution time of script
CRM_Core_Error::debug_log_message('ParticipantProcessor.php');
}
示例6: authenticate
/**
* @param $user
* @param $pass
*/
function authenticate($user, $pass)
{
session_start();
require_once 'CRM/Core/Config.php';
$config =& CRM_Core_Config::singleton();
// this does not return on failure
// require_once 'CRM/Utils/System.php';
// CRM_Utils_System::authenticateScript( true );
CRM_Utils_System::authenticateScript(TRUE, $user, $pass);
}
示例7: __construct
function __construct()
{
$config = CRM_Core_Config::singleton();
// this does not return on failure
require_once 'CRM/Utils/System.php';
require_once 'CRM/Utils/Hook.php';
CRM_Utils_System::authenticateScript(TRUE);
$config->cleanURL = 1;
//log the execution time of script
CRM_Core_Error::debug_log_message('UpdatePledgeRecord.php');
}
示例8: run
function run()
{
session_start();
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config =& CRM_Core_Config::singleton();
// this does not return on failure
CRM_Utils_System::authenticateScript(true);
// we now use DB locks on a per job basis
processQueue();
}
示例9: run
function run()
{
session_start();
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config =& CRM_Core_Config::singleton();
// this does not return on failure
CRM_Utils_System::authenticateScript(true);
require_once 'CRM/Core/BAO/Setting.php';
CRM_Core_BAO_Setting::doSiteMove();
echo "Site Move Completed. Please visit <a href=\"{$config->userFrameworkBaseURL}\">your moved site</a> and test the move<p>";
}
示例10: run
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2012
* $Id$
*
*/
function run()
{
session_start();
require_once '../../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
// this does not return on failure
CRM_Utils_System::authenticateScript(TRUE);
require_once 'CRM/Utils/Migrate/Export.php';
$export = new CRM_Utils_Migrate_Export();
$export->run();
}
示例11: __construct
function __construct()
{
$this->initialize();
$config = CRM_Core_Config::singleton();
require_once 'CRM/Utils/Request.php';
require_once 'CRM/Core/PseudoConstant.php';
require_once 'CRM/Contact/BAO/Contact.php';
// this does not return on failure
CRM_Utils_System::authenticateScript(TRUE);
//log the execution time of script
CRM_Core_Error::debug_log_message('UpdateGreeting.php');
}
示例12: run
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2013
* $Id$
*
*/
function run()
{
session_start();
require_once '../../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
// this does not return on failure
CRM_Utils_System::authenticateScript(TRUE);
require_once 'CRM/Utils/Migrate/Export.php';
$export = new CRM_Utils_Migrate_Export();
$export->build();
CRM_Utils_System::download('CustomGroupData.xml', 'text/plain', $export->toXML());
}
示例13: run
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2016
*/
function run()
{
session_start();
require_once '../../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
// this does not return on failure
CRM_Utils_System::authenticateScript(TRUE);
require_once 'CRM/Core/BAO/ConfigSetting.php';
$moveStatus = CRM_Core_BAO_ConfigSetting::doSiteMove();
echo $moveStatus . '<br />';
echo ts("If no errors are displayed above, the site move steps have completed successfully. Please visit <a href=\"{$config->userFrameworkBaseURL}\">your moved site</a> and test the move.");
}
示例14: run
function run()
{
session_start();
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
// this does not return on failure
CRM_Utils_System::authenticateScript(TRUE);
if (!CRM_Core_Permission::check('administer CiviCRM')) {
CRM_Utils_System::authenticateAbort("User does not have required permission (administer CiviCRM).\n", TRUE);
}
encryptDB();
}
示例15: run
/**
* A PHP cron script to run the outstanding and scheduled CiviMail jobs
* initiated by Owen Barton from a mailing sent by Lobo to crm-mail
*
* The structure of the file is set to mimiic soap.php which is a stand-alone
* script and hence does not have any UF issues. You should be able to run
* this script using a web url or from the command line
*/
function run()
{
session_start();
if (!function_exists('drush_get_context')) {
require_once '../civicrm.config.php';
}
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
// this does not return on failure
CRM_Utils_System::authenticateScript(TRUE);
// we now use DB locks on a per job basis
require_once 'CRM/Mailing/BAO/Mailing.php';
CRM_Mailing_BAO_Mailing::processQueue();
}