Ejemplo n.º 1
0
 public function __construct($exceptions = false)
 {
     parent::__construct($exceptions);
     //Tell PHPMailer to use SMTP
     $this->isSMTP();
     //Enable SMTP debugging
     // 0 = off (for production use)
     // 1 = client messages
     // 2 = client and server messages
     $this->SMTPDebug = 0;
     //Ask for HTML-friendly debug output
     $this->Debugoutput = 'html';
     //Set the hostname of the mail server
     $this->Host = "smtp.gmail.com";
     //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
     $this->Port = 587;
     //Set the encryption system to use - ssl (deprecated) or tls
     $this->SMTPSecure = 'tls';
     //Whether to use SMTP authentication
     $this->SMTPAuth = true;
     //Username to use for SMTP authentication
     $this->Username = Config::get('gmail.smtp.username', '*****@*****.**');
     //Password to use for SMTP authentication
     $enPassword = Config::get('gmail.smtp.password', ':e:sWQlpSVotD8PGXxS5kAuHlq0gMH522qtQkCYCQ0DVBI=');
     $cr = new Cryptography(Cryptography::RAND_KEY);
     $this->Password = $cr->decrypt($enPassword);
 }
Ejemplo n.º 2
0
 private function decryptRequestVars(&$arr)
 {
     foreach ($arr as $key => $val) {
         if (is_string($arr[$key])) {
             $arr[$key] = Cryptography::de($arr[$key]);
         } else {
             if (is_array($arr[$key])) {
                 $this->decryptRequestVars($arr[$key]);
             }
         }
     }
 }
Ejemplo n.º 3
0
 private function encryptValue($key, $value)
 {
     if (isset($this->exemptKeys[$key])) {
         return $value;
     } else {
         return Cryptography::en($value);
     }
 }
Ejemplo n.º 4
0
 private function renderValue($rowIdx, $colName, $value)
 {
     $html = '';
     $name = $this->gridTag . '[' . $rowIdx . '][' . $colName . ']';
     $autoUpdateJS = "autoUpdate({$rowIdx},'{$this->updTag}','{$this->delTag}','{$this->submitId}');";
     $id = $this->gridTag . '_' . $rowIdx . '_' . $colName;
     $updClickAttrib = ['onClick' => $autoUpdateJS, 'id' => $id];
     $updCheckAttrib = ['onChange' => $autoUpdateJS, 'id' => $id];
     $type = $this->getColumnType($colName);
     switch ($type) {
         case self::NONE:
             break;
         case self::DISPLAY:
             $html .= $value == '' ? ' ' : Tag::e($value);
             break;
         case self::HIDDEN:
             $this->resp->set($name, $value);
             break;
         case self::RADIO:
             $dispList = isset($this->displayType[$colName][1]) ? $this->displayType[$colName][1] : null;
             $updCheckAttrib['default'] = $value;
             $html .= Tag::table() . Tag::tr() . Tag::td(['nowrap' => 'nowrap']) . implode(Tag::_td() . Tag::td(['nowrap' => 'nowrap']), Lists::radio($name, $dispList, $updCheckAttrib)) . Tag::_td() . Tag::_tr() . Tag::_table();
             break;
         case self::SELECT:
             $dispList = isset($this->displayType[$colName][1]) ? $this->displayType[$colName][1] : null;
             $blankLine = isset($this->displayType[$colName][2]) ? $this->displayType[$colName][2] : false;
             $updCheckAttrib['default'] = $value;
             $updCheckAttrib['hasBlank'] = $blankLine;
             $html .= Lists::select($name, $dispList, $updCheckAttrib);
             break;
         case self::CHECKBOX:
             $checkValue = isset($this->displayType[$colName][1]) ? $this->displayType[$colName][1] : 'YES';
             $html .= Tag::checkBox($name, $checkValue, $value == $checkValue, $updClickAttrib);
             break;
         case self::TIMESTAMP:
             $attribs = array_merge($updCheckAttrib, $this->cellAttributes[$colName]);
             $attribs['value'] = strftime('%Y-%m-%d %H:%M:%S', (int) $value);
             $attribs['size'] = strlen($attribs['value']) + 1;
             $html .= Tag::text($name, $attribs);
             break;
         case self::ENCTEXT:
             $value = Cryptography::de((string) $value);
             // Fall through to output text field
         // Fall through to output text field
         case self::TEXT:
         default:
             $updCheckAttrib['value'] = (string) $value;
             $html .= Tag::text($name, array_merge($updCheckAttrib, $this->cellAttributes[$colName]));
             break;
     }
     if (!in_array($type, [self::HIDDEN, self::NONE])) {
         $html = Tag::td() . $html . Tag::_td();
     }
     return $html;
 }