Пример #1
0
 public static function getVar($v = 'tbl')
 {
     static $vars = array();
     if (!isset($vars[$v])) {
         $vars[$v] = MRequest::getString('ja_' . $v . '_p', '', 'post');
         if (empty($vars[$v])) {
             $_var = base64_decode(MRequest::getString('ja_' . $v . '_g', '', 'get'));
             $vars[$v] = stripslashes($_var);
         }
     }
     return $vars[$v];
 }
Пример #2
0
 public function delete($table)
 {
     $sql = MiwosqlHelper::getVar('qry');
     $key = MRequest::getString('key', null, 'get');
     if (!is_null($sql) && !is_null($key)) {
         $id = MRequest::getCmd('id', null, 'get');
         $this->_db->setQuery("DELETE FROM {$table} WHERE {$key} = '{$id}'");
         $this->_db->query();
         if (!empty($this->_db->_errorMsg)) {
             echo '<small style="color:red;">' . $this->_db->_errorMsg . '</small><br/>';
             return false;
         } else {
             return true;
         }
     }
 }
Пример #3
0
 function getQueryData()
 {
     $query = MRequest::getString('ja_query', '', 'get');
     if (!empty($query)) {
         $data = new stdClass();
         $data->id = 0;
         $data->title = '';
         $data->query = base64_decode($query);
     } else {
         $cid = MRequest::getVar('cid', array(0), 'method', 'array');
         $id = $cid[0];
         $data = MTable::getInstance('Query', 'Table');
         $data->load($id);
         $data->query = base64_decode($data->query);
     }
     return $data;
 }
Пример #4
0
 public static function setCredentialsFromRequest($client)
 {
     // Determine whether FTP credentials have been passed along with the current request
     $user = MRequest::getString('username', null, 'POST', MREQUEST_ALLOWRAW);
     $pass = MRequest::getString('password', null, 'POST', MREQUEST_ALLOWRAW);
     if ($user != '' && $pass != '') {
         // Add credentials to the session
         if (MClientHelper::setCredentials($client, $user, $pass)) {
             $return = false;
         } else {
             $return = MError::raiseWarning('SOME_ERROR_CODE', MText::_('MLIB_CLIENT_ERROR_HELPER_SETCREDENTIALSFROMREQUEST_FAILED'));
         }
     } else {
         // Just determine if the FTP input fields need to be shown
         $return = !MClientHelper::hasCredentials('ftp');
     }
     return $return;
 }