Example #1
0
 /**
  * Applies action
  *
  * @return  boolean success
  */
 protected function main()
 {
     $recipient = Nexista_Path::parseInlineFlow($this->params['recipient']);
     $sender = Nexista_Path::parseInlineFlow($this->params['sender']);
     $subject = "Subject: " . Nexista_Path::parseInlineFlow($this->params['subject']) . "\n";
     $body = Nexista_Flow::getbypath($this->params['body']);
     $host = Nexista_Path::parseInlineFlow($this->params['host']);
     if (require 'Net/SMTP.php') {
         $smtp = new Net_SMTP($host);
         $e = $smtp->connect();
         $smtp->mailFrom($sender);
         $disclosed_recipients = "To: ";
         if (is_array($recipient)) {
             foreach ($recipient as $to) {
                 if (PEAR::isError($res = $smtp->rcptTo($to))) {
                     die("Unable to add recipients {$to}: " . $res->getMessage() . "\n");
                 }
                 $disclosed_recipients .= $to;
             }
         } else {
             if (PEAR::isError($res = $smtp->rcptTo($recipient))) {
                 die("Unable to add single recipient {$recipient} for {$host}: " . $res->getMessage() . "\n");
             }
             $disclosed_recipients .= $recipient;
         }
         $disclosed_recipients .= "\n";
         $headers = $disclosed_recipients . $subject;
         $smtp->data($headers . "\r\n" . $body);
         $smtp->disconnect();
     } else {
         // try using mail()
     }
 }
Example #2
0
 /**
  * Applies action
  *
  * @return  boolean success
  */
 protected function main()
 {
     $text = Nexista_Path::get($this->params['haystack']);
     $tokens = Nexista_Flow::getbypath($this->params['token_array_xpath']);
     /*
     echo "<pre>";
     print_r($tokens);
     echo "</pre>";
     echo "<br/>";
     */
     foreach ($tokens as $token) {
         $text = str_replace($token['key'], Nexista_Flow::getbypath($token['value']), $text);
     }
     Nexista_Flow::add('new_text', $text);
     return true;
 }
Example #3
0
 /**
  * Applies action
  *
  * @return  boolean success
  */
 protected function main()
 {
     $ids_x = $this->params['ids'];
     $ids = Nexista_Flow::find($ids_x);
     $params = Nexista_Flow::getbypath($this->params['param_array_xpath']);
     foreach ($ids as $id) {
         $link = "";
         foreach ($params as $param) {
             //$link .= $param['name']."=";
             $myname = $param['name'];
             if ($myname == "key") {
                 $link .= $id->nodeValue . "/";
             } else {
                 $myval = Nexista_Flow::getbypath($param['value']);
                 $link .= $myval . "/";
             }
         }
         $id->nodeValue = $link;
     }
     return true;
 }
Example #4
0
Component: config_build.php
Copyright: Savonix Corporation
Author: Albert L. Lash, IV
License: Gnu Affero Public License version 3
http://www.gnu.org/licenses

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program; if not, see http://www.gnu.org/licenses
or write to the Free Software Foundation, Inc., 51 Franklin Street,
Fifth Floor, Boston, MA 02110-1301 USA
--> */
$config = Nexista_Flow::getbypath('/_R_/config_get/config_get');
$code = '<?php $config = array(';
foreach ($config as $conf_item) {
    // The crazy encoding / decoding is used for double and single quote variations
    // Basically we want to escape single quotes for the array only.
    $code .= "'" . $conf_item['conf_name'] . "' => '" . htmlspecialchars_decode(addslashes(htmlspecialchars($conf_item['conf_value'], ENT_COMPAT)), ENT_COMPAT) . "',\n";
}
$code .= '); ?>';
$config_cache = NX_PATH_COMPILE . $_SERVER['HTTP_HOST'] . '_config_cache.php';
file_put_contents($config_cache, $code);