Example #1
0
 function addFile($object, $if = '')
 {
     if (function_exists('core_internalError')) {
         if (!is_file($object)) {
             core_internalError("Cant load '{$object}'", $this);
         }
     }
     $s = x("script language='javascript' src='{$object}'");
     if ($if) {
         $s = '<!--[' . $if . ']>' . $s . '<![endif]-->';
     }
     if (!$GLOBALS["cacheJS"]["cont"][$object]++) {
         $GLOBALS["cacheJS"]["file"][] = $s;
     }
 }
Example #2
0
 function moo()
 {
     $this->js = new js();
     if (!$GLOBALS["MooToolsCounter"]) {
         $GLOBALS["MooToolsCounter"] = 1;
         foreach (array('css/moo/js', 'css') as $d) {
             if (is_dir($d) && is_file("{$d}/mootools.js")) {
                 $this->js->addFile("{$d}/mootools.js");
                 $this->js->addFile("{$d}/dialog.js");
                 // <!--[if lte IE 6]><link rel=stylesheet href='$d/moo-ie6.css'><![endif]-->
                 return;
             }
         }
         core_internalError("cant load scripts", $this);
     }
 }
Example #3
0
function core_declare_input($vname, $default = NULL, $desc = NULL)
{
    global ${$vname};
    if (!is_null(@$_POST[$vname])) {
        ${$vname} = core_unquote_gpc(chop($_POST[$vname]));
    } else {
        if (!is_null(@$_GET[$vname])) {
            ${$vname} = core_unquote_gpc(chop($_GET[$vname]));
        } else {
            if (!is_null(@$_FILES[$vname])) {
                core_warning("using core_declare_input to declare file");
                ${$vname} = @$_FILES[$vname];
            } else {
                if (!is_null($default)) {
                    ${$vname} = $default;
                } else {
                    ${$vname} = '';
                }
            }
        }
    }
    ${$vname} = trim(${$vname});
    if (is_null($default) && ${$vname} == '') {
        if (!is_null($desc)) {
            core_internalError("Missing value for '{$desc}'.");
        } else {
            core_internalError("Missing value for input variable '{$vname}'.");
        }
    }
}
Example #4
0
 function send($to, $subject, $message, $countThisMail = True, $signThisMail = True)
 {
     global $apps_listOfEmails;
     $this->dbg('send', "to={$to} from={$this->from} subject=" . $this->subjectID . $subject);
     if (!$this->from) {
         $this->from = 'noReply';
     }
     if (!$this->fromExtended) {
         $this->fromExtended = $this->from;
     }
     if (!$this->signature) {
         $this->signature = core_getConfig('signature', 'Computing support');
     }
     if ($GLOBALS["mailDejaVu"][$to][$this->fromExtended][$subject]++) {
         return;
     }
     if ($this->cc) {
         $headers[] = "Cc: {$this->cc}";
     }
     if ($this->bcc) {
         $headers[] = "Bcc: {$this->bcc}";
     }
     $headers[] = "X-Mailer: mailClassYB";
     $realTO = core_getConfig('redirectMailsInPlaygoundMode') && core_getOption('playground') ? core_getConfig('plygroundEmail') : $to;
     $realTOdisplay = $realTO == $to ? $to : "{$realTO} &lt;{$to}&gt;";
     if ($signThisMail) {
         $message .= $this->signature;
     }
     $autoSignature = "this is an automatic e-mail sent by the {$this->mailID}";
     while ($l++ < strlen($autoSignature)) {
         $autoSignature1 .= '-';
     }
     $message .= join("\n", array("\n", $autoSignature1, $autoSignature));
     if (core_getOption('playground')) {
         $message = "*** This E-mail is sent by the test version of the {$this->mailID} software and should be ignored\n" . "*** (unless you participate in the debugging and expect this E-mail).\n" . "*** Sorry if you got it my mistake...\n\n" . $message;
     }
     if (core_getConfig('dontSendMail_Point')) {
         $this->reallySendMail = False;
     }
     if ($this->reallySendMail) {
         $headers[] = "From: " . $this->fromExtended;
         $crlf = "\r\n";
         #print "realTO=$realTO<br>";$realTO='*****@*****.**';
         if (!mail($realTO, $this->subjectID . $subject, $message, join($crlf, $headers) . $crlf)) {
             core_internalError(get_class($this) . " Can't send an E-mail to {$realTOdisplay}<br>Please restart the procedure");
         }
         // keep trace of the mails sent, useful for a summary
         core_syslog("mail from={$this->from} to={$realTO}" . ($to == $realTO ? "" : "<{$to}>") . " subject={$subject}");
         if ($countThisMail) {
             $apps_listOfEmails[$realTOdisplay][] = $this->subjectID . $subject;
             $this->log($realTO, $this->from, $subject);
         }
     } else {
         $headers[] = "From: " . $this->fromForDebug;
         core_importantMessage("The following E-mail is prepared, but NOT sent:", 'h3', '<b>' . join('<br>', array("To: {$realTOdisplay}", "Subject: " . $this->subjectID . $subject, join('<br>', $headers) . '</b><br><br>' . eregi_replace(' ', '&nbsp;', eregi_replace("\n", "<br>", $message)))));
     }
 }