本文整理汇总了PHP中Vtiger_Functions::recurseDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions::recurseDelete方法的具体用法?PHP Vtiger_Functions::recurseDelete怎么用?PHP Vtiger_Functions::recurseDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Functions
的用法示例。
在下文中一共展示了Vtiger_Functions::recurseDelete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteKey
public function deleteKey($params)
{
$adb = PearDatabase::getInstance();
$adb->pquery('DELETE dav_calendars FROM dav_calendars LEFT JOIN dav_principals ON dav_calendars.principaluri = dav_principals.uri WHERE dav_principals.userid = ?;', array($params['user']));
$adb->pquery('DELETE FROM dav_users WHERE userid = ?;', array($params['user']));
$adb->pquery('DELETE FROM dav_principals WHERE userid = ?;', array($params['user']));
$user = Users_Record_Model::getInstanceById($params['user'], 'Users');
$user_name = $user->get('user_name');
$davStorageDir = vglobal('davStorageDir');
Vtiger_Functions::recurseDelete($davStorageDir . '/' . $user_name);
}
示例2: postupdate
function postupdate()
{
global $log, $adb;
$dirName = 'cache/updates';
$result = true;
Vtiger_Deprecated::createModuleMetaFile();
Vtiger_Access::syncSharingAccess();
$adb->query('SET FOREIGN_KEY_CHECKS = 1;');
$currentUser = Users_Record_Model::getCurrentUserModel();
$adb->query("INSERT INTO `yetiforce_updates` (`user`, `name`, `from_version`, `to_version`, `result`) VALUES ('" . $currentUser->get('user_name') . "', '" . $this->modulenode->label . "', '" . $this->modulenode->from_version . "', '" . $this->modulenode->to_version . "','" . $result . "');", true);
$adb->query("UPDATE vtiger_version SET `current_version` = '" . $this->modulenode->to_version . "';");
Vtiger_Functions::recurseDelete($dirName . '/files');
Vtiger_Functions::recurseDelete($dirName . '/init.php');
Vtiger_Functions::recurseDelete('cache/templates_c');
header('Location: ' . vglobal('site_URL'));
exit;
return true;
}
示例3: import_update
function import_update($modulenode)
{
$dirName = 'cache/updates';
$result = false;
$adb = PearDatabase::getInstance();
if (file_exists($dirName . '/init.php')) {
require_once $dirName . '/init.php';
$adb->query('SET FOREIGN_KEY_CHECKS = 0;');
$Instance = new YetiForceUpdate($modulenode);
$Instance->package = $this;
$result = $Instance->preupdate();
if ($result != false) {
$Instance->update();
if ($Instance->filesToDelete) {
foreach ($Instance->filesToDelete as $path) {
Vtiger_Functions::recurseDelete($path);
}
}
Vtiger_Functions::recurseCopy($dirName . '/files', '', true);
$result = $Instance->postupdate();
}
$adb->query('SET FOREIGN_KEY_CHECKS = 1;');
}
$currentUser = Users_Record_Model::getCurrentUserModel();
$adb->query("INSERT INTO `yetiforce_updates` (`user`, `name`, `from_version`, `to_version`, `result`) VALUES ('" . $currentUser->get('user_name') . "', '" . $modulenode->label . "', '" . $modulenode->from_version . "', '" . $modulenode->to_version . "','" . $result . "');", true);
if ($result) {
$adb->query("UPDATE vtiger_version SET `current_version` = '" . $modulenode->to_version . "';");
}
Vtiger_Functions::recurseDelete($dirName . '/files');
Vtiger_Functions::recurseDelete($dirName . '/init.php');
Vtiger_Functions::recurseDelete('cache/templates_c');
}
示例4: deleteDir
/**
* Function to remove files related to a module
* @param string $path - dir path
*/
public function deleteDir($moduleInstance)
{
self::log(__CLASS__ . '::' . __METHOD__ . ' | Start');
$modulePath = 'modules/' . $moduleInstance->name;
Vtiger_Functions::recurseDelete($modulePath);
foreach (Yeti_Layout::getAllLayouts() as $name => $label) {
$layoutPath = 'layouts/' . $name . '/modules/' . $moduleInstance->name;
Vtiger_Functions::recurseDelete($layoutPath);
}
self::log(__CLASS__ . '::' . __METHOD__ . ' | END');
}
示例5: process
function process(Vtiger_Request $request)
{
$username = $request->get('username');
$password = $request->get('password');
if ($request->get('mode') == 'install') {
$dirPath = 'install';
Users_Module_Model::deleteLangFiles();
$configTemplate = "config/config.template.php";
if (file_exists($configTemplate)) {
unlink($configTemplate);
}
Vtiger_Functions::recurseDelete($dirPath);
}
$checkBlocked = Settings_BruteForce_Module_Model::checkBlocked();
$bruteForceSettings = Settings_BruteForce_Module_Model::getBruteForceSettings();
if ($checkBlocked && $bruteForceSettings['active']) {
Settings_BruteForce_Module_Model::sendNotificationEmail();
header('Location: index.php?module=Users&parent=Settings&view=Login&error=2');
exit;
}
$user = CRMEntity::getInstance('Users');
$user->column_fields['user_name'] = $username;
$moduleModel = Users_Module_Model::getInstance('Users');
if ($user->doLogin($password)) {
if (vglobal('session_regenerate_id')) {
Vtiger_Session::regenerateId(true);
}
// to overcome session id reuse.
$userid = $user->retrieve_user_id($username);
Vtiger_Session::set('AUTHUSERID', $userid);
// For Backward compatability
// TODO Remove when switch-to-old look is not needed
Vtiger_Session::set('authenticated_user_id', $userid);
Vtiger_Session::set('app_unique_key', vglobal('application_unique_key'));
Vtiger_Session::set('authenticated_user_language', vglobal('default_language'));
Vtiger_Session::set('user_name', $username);
Vtiger_Session::set('full_user_name', Vtiger_Functions::getUserRecordLabel($userid));
if ($request->has('language') && vglobal('langInLoginView')) {
Vtiger_Session::set('language', $request->get('language'));
}
if ($request->has('layout')) {
Vtiger_Session::set('layout', $request->get('layout'));
}
//Enabled session variable for KCFINDER
$_SESSION['KCFINDER'] = array();
$_SESSION['KCFINDER']['disabled'] = false;
$_SESSION['KCFINDER']['uploadURL'] = "cache/upload";
$_SESSION['KCFINDER']['uploadDir'] = "../../cache/upload";
$deniedExts = implode(" ", vglobal('upload_badext'));
$_SESSION['KCFINDER']['deniedExts'] = $deniedExts;
// End
//Track the login History
$moduleModel->saveLoginHistory($user->column_fields['user_name']);
//End
if (isset($_SESSION['return_params'])) {
$return_params = urldecode($_SESSION['return_params']);
header("Location: index.php?{$return_params}");
exit;
} else {
header('Location: index.php');
exit;
}
} else {
//Track the login History
$browser = Settings_BruteForce_Module_Model::browserDetect();
$moduleModel->saveLoginHistory($username, 'Failed login', $browser);
header('Location: index.php?module=Users&parent=Settings&view=Login&error=1');
exit;
}
}
示例6: deregister
static function deregister($name)
{
if (strtolower($name) == 'basic') {
return;
}
$adb = PearDatabase::getInstance();
$adb->delete(self::TABLENAME, 'name = ?', [$name]);
Vtiger_Functions::recurseDelete('layouts' . DIRECTORY_SEPARATOR . $name);
self::log("Deregistering Layout {$name} ... DONE");
}
示例7: deleteDir
/**
* Function to remove files related to a module
* @param string $path - dir path
*/
public function deleteDir($moduleInstance)
{
self::log(__CLASS__ . '::' . __METHOD__ . ' | Start');
$modulePath = 'modules/' . $moduleInstance->name;
Vtiger_Functions::recurseDelete($modulePath);
$layoutPath = 'layouts/vlayout/modules/' . $moduleInstance->name;
Vtiger_Functions::recurseDelete($layoutPath);
self::log(__CLASS__ . '::' . __METHOD__ . ' | END');
}