Exemple #1
0
 /**
  * Get or set our $_COOKIE var via . sperated array access
  *
  * @param key string A period seperated string of array keys and values
  * @param value string The value to be set
  *
  * @return string
  */
 static function cookie($key, $value = null)
 {
     $key = ID . '_' . $key;
     if (!is_null($value)) {
         //set the cookie expirey to 24 hours time
         setcookie($key, Encrypt::encrypt($value), time() + 3600 * 24);
         return;
     }
     return Encrypt::decrypt($_COOKIE[$key]);
 }
Exemple #2
0
 foreach ($dataQuery->rows as $dataRow) {
     $line = array();
     $line[] = $dataRow->signed;
     foreach ($result->rows as $row) {
         $field = NULL;
         if (in_array($row->fieldID, $skipFields)) {
             continue;
         }
         if (isset($dataRow->{$row->dl_name})) {
             $field = $dataRow->{$row->dl_name};
         } elseif (isset($dataRow->{$row->finalFieldName})) {
             $field = $dataRow->{$row->finalFieldName};
         }
         if (in_array($row->fieldID, $encryptedFields) && !is_null($field)) {
             $td = new Encrypt($_SESSION['user']->getKey());
             $field = $td->decrypt($field);
             if (!$encrypted && $row->fieldName === 'age') {
                 if ($field > 90) {
                     $field = 'Over 90';
                 }
             }
         }
         switch ($row->type) {
             case 'checkbox':
                 $sql = "SELECT {$row->fieldName}_id as cbVal FROM {$row->pages_name}{$row->fieldName} WHERE {$row->pages_name}_id = ?";
                 $pA = array('i', $dataRow->{$row->pages_name . '_id'});
                 $cbVal = DB::query($sql, $pA);
                 $field = $cbVal->getArray('cbVal');
                 foreach ($cbFields[$row->pages_name][$row->fieldName] as $cb) {
                     if (emptyInput($field)) {
                         $line[] = "";
Exemple #3
0
 /**
  * email defaults and SMTP connections details
  *
  * @return array
  */
 public static function email()
 {
     return array('header' => MODULE_PATH . '/views/partials/email-header.php', 'footer' => MODULE_PATH . '/views/partials/email-footer.php', 'from-address' => '*****@*****.**', 'from-name' => 'Test Testingsom', 'smtp' => false, 'smtp-port' => '465', 'smtp-username' => '*****@*****.**', 'smtp-password' => Encrypt::decrypt('LQScrjgIlXBPd85JJWOJgoK5iH+1jYrgEiVd/Jl7BWErBKAKQoq6mHwfWXgCuHcenRbGmv2drbncgqvrlORFiA=='), 'smtp-host' => 'ssl://smtp.gmail.com');
 }
Exemple #4
0
 echo "<li>Accessed by {$auditUser} from {$session['userip']} on \n                {$date} at {$time} <i data-toggle=\"collapse\" \n                href=\"#collapse{$counter}\" class=\"list-toggle icon-expand\"></i></label></li>";
 echo "<ul id=\"collapse{$counter}\" class=\"collapse\">";
 foreach ($session['audit'] as $row) {
     if ($row->field == 'complete') {
         continue;
     }
     $field = $trial->record->getFieldData($row->tableName, $row->field);
     if (is_null($field)) {
         continue;
     }
     if ($field->encrypted) {
         if (!$user->isCentralAdmin()) {
             continue;
         }
         $td = new Encrypt($user->getKey());
         $row->old_value = $td->decrypt($row->old_value);
         $row->new_value = $td->decrypt($row->new_value);
     }
     $dt = splitDateTime($row->time);
     $time = $dt['time'];
     $sql = "SELECT value FROM formVal WHERE formFields_id = ? AND operator = 'IN LIST' ORDER BY groupNum";
     $pA = array('i', $field->id);
     $ruleSearch = DB::query($sql, $pA);
     if ($ruleSearch->getRows()) {
         $rule = $ruleSearch->value;
     } else {
         $rule = NULL;
     }
     if ($row->old_value) {
         $ov = $trial->record->displayFieldValue($row->old_value, $field->type, $rule);
         if ($field->type == 'checkbox') {
Exemple #5
0
 protected function decrypt_obj()
 {
     foreach ($this->_encrypted as $e) {
         if (isset($this->{$e}) && !empty($this->{$e})) {
             if (!isset($td)) {
                 $td = new Encrypt($_SESSION['user']->getKey());
             }
             $this->{$e} = $this->{'old_' . $e} = $td->decrypt($this->{$e});
         }
     }
 }
Exemple #6
0
 public function setKey($pass, $key)
 {
     $td = new Encrypt($pass);
     $this->key = $td->decrypt($key);
 }