當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Vtiger_Viewer::setTemplateDir方法代碼示例

本文整理匯總了PHP中Vtiger_Viewer::setTemplateDir方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Viewer::setTemplateDir方法的具體用法?PHP Vtiger_Viewer::setTemplateDir怎麽用?PHP Vtiger_Viewer::setTemplateDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Vtiger_Viewer的用法示例。


在下文中一共展示了Vtiger_Viewer::setTemplateDir方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: mStep3

 public function mStep3(Vtiger_Request $request)
 {
     $system = $request->get('system');
     $source_directory = $request->get('source_directory');
     $username = $request->get('username');
     $password = $request->get('password');
     $errorText = '';
     $loginStatus = false;
     $migrationURL = 'Install.php?mode=execute&ajax=true&system=' . $system . '&user=' . $username;
     $viewer = new Vtiger_Viewer();
     $createConfig = Install_InitSchema_Model::createConfig($source_directory, $username, $password, $system);
     if ($createConfig['result']) {
         include 'config/config.inc.php';
         $adb = new PearDatabase($dbconfig['db_type'], $dbconfig['db_hostname'], $dbconfig['db_name'], $dbconfig['db_username'], $dbconfig['db_password']);
         vglobal('adb', $adb);
         $query = "SELECT crypt_type, user_name FROM vtiger_users WHERE user_name=?";
         $result = $adb->requirePsSingleResult($query, array($username), true);
         if ($adb->num_rows($result) > 0) {
             $crypt_type = $adb->query_result($result, 0, 'crypt_type');
             $salt = substr($username, 0, 2);
             if ($crypt_type == 'MD5') {
                 $salt = '$1$' . $salt . '$';
             } elseif ($crypt_type == 'BLOWFISH') {
                 $salt = '$2$' . $salt . '$';
             } elseif ($crypt_type == 'PHP5.3MD5') {
                 $salt = '$1$' . str_pad($salt, 9, '0');
             }
             $encrypted_password = crypt($password, $salt);
             $query = "SELECT 1 from vtiger_users where user_name=? AND user_password=? AND status = ?";
             $result = $adb->requirePsSingleResult($query, array($username, $encrypted_password, 'Active'), true);
             if ($adb->num_rows($result) > 0) {
                 $loginStatus = true;
             }
         }
         if (!$loginStatus) {
             $errorText = 'LBL_WRONG_USERNAME_OR_PASSWORD';
             file_put_contents('config/config.inc.php', '');
         }
     } else {
         $errorText = $createConfig['text'];
     }
     $viewer->setTemplateDir('install/tpl/');
     $viewer->assign('LANG', $request->get('lang'));
     $viewer->assign('MIGRATIONURL', $migrationURL);
     $viewer->assign('ERRORTEXT', $errorText);
     $viewer->assign('MIGRATIONRESULT', $migrationResult);
     echo $viewer->fetch('mStep3.tpl');
     if ($loginStatus) {
         echo $viewer->fetch('mStep3Pre.tpl');
         $migrationResult = Install_InitSchema_Model::executeMigrationSchema($system, $username, $source_directory);
         echo $viewer->fetch('mStep3Post.tpl');
     }
 }
開發者ID:artisan4710,項目名稱:YetiForceCRM,代碼行數:53,代碼來源:Index.php


注:本文中的Vtiger_Viewer::setTemplateDir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。