Exemple #1
0
function process_new_cache($notify)
{
    global $opt, $debug, $debug_mailto, $rootpath, $translate;
    global $maildomain, $mailfrom;
    //echo "process_new_cache(".$notify['id'].")\n";
    $error = false;
    // fetch email template
    switch ($notify['type']) {
        case notify_new_cache:
            // Type: new cache
            $mailbody = fetch_email_template('notify_newcache', $notify['recp_lang'], $notify['recp_domain']);
            $mailsubject = '[' . $maildomain . '] ' . $translate->t($notify['oconly'] ? 'New OConly cache:' : 'New cache:', '', basename(__FILE__), __LINE__, '', 1, $notify['recp_lang']) . ' ' . $notify['cachename'];
            break;
        case notify_new_oconly:
            // Type: new OConly flag
            $mailbody = fetch_email_template('notify_newoconly', $notify['recp_lang'], $notify['recp_domain']);
            $mailsubject = '[' . $maildomain . '] ' . $translate->t('Cache was marked as OConly:', '', basename(__FILE__), __LINE__, '', 1, $notify['recp_lang']) . ' ' . $notify['cachename'];
            break;
        default:
            $error = true;
            break;
    }
    if (!$error) {
        $mailbody = mb_ereg_replace('{username}', $notify['recpname'], $mailbody);
        $mailbody = mb_ereg_replace('{date}', date($opt['locale'][$notify['recp_lang']]['format']['phpdate'], strtotime($notify['date_hidden'])), $mailbody);
        $mailbody = mb_ereg_replace('{cacheid}', $notify['cache_id'], $mailbody);
        $mailbody = mb_ereg_replace('{wp_oc}', $notify['wp_oc'], $mailbody);
        $mailbody = mb_ereg_replace('{user}', $notify['username'], $mailbody);
        $mailbody = mb_ereg_replace('{cachename}', $notify['cachename'], $mailbody);
        $mailbody = mb_ereg_replace('{distance}', round(geomath::calcDistance($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2'], 1), 1), $mailbody);
        $mailbody = mb_ereg_replace('{unit}', 'km', $mailbody);
        $mailbody = mb_ereg_replace('{bearing}', geomath::Bearing2Text(geomath::calcBearing($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2']), 0, $notify['recp_lang']), $mailbody);
        $mailbody = mb_ereg_replace('{cachetype}', get_cachetype_name($notify['cachetype'], $notify['recp_lang']), $mailbody);
        $mailbody = mb_ereg_replace('{cachesize}', get_cachesize_name($notify['cachesize'], $notify['recp_lang']), $mailbody);
        $mailbody = mb_ereg_replace('{oconly-}', $notify['oconly'] ? $translate->t('OConly-', '', basename(__FILE__), __LINE__, '', 1, $notify['recp_lang']) : '', $mailbody);
        /* begin send out everything that has to be sent */
        $email_headers = 'From: "' . $mailfrom . '" <' . $mailfrom . '>';
        // send email
        if ($debug == true) {
            $mailadr = $debug_mailto;
        } else {
            $mailadr = $notify['email'];
        }
        if (is_existent_maildomain(getToMailDomain($mailadr))) {
            mb_send_mail($mailadr, $mailsubject, $mailbody, $email_headers);
        }
    } else {
        echo "Unknown notification type: " . $notify['type'] . "<br />";
    }
    // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
    logentry('notify_newcache', 8, $notify['recid'], $notify['cache_id'], 0, 'Sending mail to ' . $mailadr, []);
    return 0;
}
Exemple #2
0
function process_new_cache($notify)
{
    global $notify_text, $mailfrom, $mailsubject, $debug, $debug_mailto, $rootpath;
    //echo "process_new_cache(".$notify['id'].")\n";
    $fehler = false;
    // mail-template lesen
    switch ($notify['type']) {
        case notify_new_cache:
            // Type: new cache
            $mailbody = read_file($rootpath . 'util/notification/notify_newcache.email');
            break;
        default:
            $fehler = true;
            break;
    }
    if (!$fehler) {
        $mailbody = mb_ereg_replace('{username}', $notify['recpname'], $mailbody);
        $mailbody = mb_ereg_replace('{date}', date('d.m.Y', strtotime($notify['date_hidden'])), $mailbody);
        $mailbody = mb_ereg_replace('{cacheid}', $notify['cache_id'], $mailbody);
        $mailbody = mb_ereg_replace('{wp_oc}', $notify['wp_oc'], $mailbody);
        $mailbody = mb_ereg_replace('{user}', $notify['username'], $mailbody);
        $mailbody = mb_ereg_replace('{cachename}', $notify['cachename'], $mailbody);
        $mailbody = mb_ereg_replace('{distance}', round(calcDistance($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2'], 1), 1), $mailbody);
        $mailbody = mb_ereg_replace('{unit}', 'km', $mailbody);
        $mailbody = mb_ereg_replace('{bearing}', Bearing2Text(calcBearing($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2'])), $mailbody);
        $mailbody = mb_ereg_replace('{cachetype}', $notify['cachetype'], $mailbody);
        $mailbody = mb_ereg_replace('{cachesize}', $notify['cachesize'], $mailbody);
        $subject = mb_ereg_replace('{cachename}', $notify['cachename'], $mailsubject);
        /* begin send out everything that has to be sent */
        $email_headers = 'From: "' . $mailfrom . '" <' . $mailfrom . '>';
        // mail versenden
        if ($debug == true) {
            $mailadr = $debug_mailto;
        } else {
            $mailadr = $notify['email'];
        }
        if (is_existent_maildomain(getToMailDomain($mailadr))) {
            mb_send_mail($mailadr, $subject, $mailbody, $email_headers);
        }
    } else {
        echo "Unbekannter Notification-Typ: " . $notify['type'] . "<br />";
    }
    // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
    logentry('notify_newcache', 5, $notify['recid'], $notify['cache_id'], 0, 'Sending mail to ' . $mailadr, array());
    return 0;
}
function process_new_cache($notify)
{
    global $mailfrom, $mailsubject, $debug, $debug_mailto, $rootpath, $octeamEmailsSignature, $absolute_server_URI, $site_name, $dateFormat, $cacheTypes, $cacheSizes, $cacheTypeIcons;
    $fehler = false;
    switch ($notify['type']) {
        case notify_new_cache:
            // Type: new cache
            //$emailFilePath = 'util.sec/notification/notify_newcache.email';
            $emailFilePath = '/notifyNewcacheEmail.html';
            //$mailbody = read_file($rootpath.$emailFilePath);
            $mailbody = file_get_contents(__DIR__ . $emailFilePath);
            break;
        default:
            $fehler = true;
            break;
    }
    if (!$fehler) {
        $thunderSection = ' (<img src="' . $absolute_server_URI . 'tpl/stdstyle/images/blue/thunder_ico.png" alt="user activity" width="9" height="9" border="0" title="' . tr('viewlog_aktywnosc') . ' [' . $notify['found'] . '+' . $notify['dnf'] . '+' . $notify['hidden'] . ']"/>' . ($notify['hidden'] + $notify['found'] + $notify['dnf']) . ') ';
        $mailbody = mb_ereg_replace('{username}', htmlspecialchars($notify['recpname'], ENT_COMPAT, 'UTF-8'), $mailbody);
        $mailbody = mb_ereg_replace('{date}', date($dateFormat, strtotime($notify['date_hidden'])), $mailbody);
        $mailbody = mb_ereg_replace('{cacheid}', $notify['cache_id'], $mailbody);
        $mailbody = mb_ereg_replace('{wp_oc}', $notify['wp_oc'], $mailbody);
        $mailbody = mb_ereg_replace('{user}', htmlspecialchars($notify['username'], ENT_COMPAT, 'UTF-8'), $mailbody);
        $mailbody = mb_ereg_replace('{cachename}', htmlspecialchars($notify['cachename'], ENT_COMPAT, 'UTF-8'), $mailbody);
        $mailbody = mb_ereg_replace('{distance}', round(calcDistance($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2'], 1), 1), $mailbody);
        $mailbody = mb_ereg_replace('{unit}', 'km', $mailbody);
        $mailbody = mb_ereg_replace('{bearing}', Bearing2Text(calcBearing($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2'])), $mailbody);
        $mailbody = mb_ereg_replace('{cachetype}', tr($cacheTypes[$notify['cachetype']]['translation']), $mailbody);
        $mailbody = mb_ereg_replace('{cachesize}', tr($cacheSizes[$notify['cachesize']]['translation']), $mailbody);
        $mailbody = mb_ereg_replace('{server}', $absolute_server_URI, $mailbody);
        $mailbody = mb_ereg_replace('{sitename}', $site_name, $mailbody);
        $mailbody = mb_ereg_replace('{notify_newCache_01}', tr('notify_newCache_01'), $mailbody);
        $mailbody = mb_ereg_replace('{notify_newCache_02}', tr('notify_newCache_02'), $mailbody);
        $mailbody = mb_ereg_replace('{notify_newCache_03}', tr('notify_newCache_03'), $mailbody);
        $mailbody = mb_ereg_replace('{notify_newCache_04}', tr('notify_newCache_04'), $mailbody);
        $mailbody = mb_ereg_replace('{notify_newCache_05}', tr('notify_newCache_05'), $mailbody);
        $mailbody = mb_ereg_replace('{notify_newCache_06}', tr('notify_newCache_06'), $mailbody);
        $mailbody = mb_ereg_replace('{notify_newCache_07}', tr('notify_newCache_07'), $mailbody);
        $mailbody = mb_ereg_replace('{notify_newCache_08}', tr('notify_newCache_08'), $mailbody);
        $mailbody = mb_ereg_replace('{notify_newCache_09}', tr('notify_newCache_09'), $mailbody);
        $mailbody = mb_ereg_replace('{octeamEmailsSignature}', $octeamEmailsSignature, $mailbody);
        $mailbody = mb_ereg_replace('{runwatch04}', tr('runwatch04'), $mailbody);
        $mailbody = mb_ereg_replace('{runwatch08}', tr('runwatch08'), $mailbody);
        $mailbody = mb_ereg_replace('{runwatch09}', tr('runwatch09'), $mailbody);
        $mailbody = mb_ereg_replace('{wp_oc}', $notify['wp_oc'], $mailbody);
        $mailbody = mb_ereg_replace('{cache_owner_id}', $notify['cache_owner_id'], $mailbody);
        $mailbody = mb_ereg_replace('{caheIcon}', $cacheTypeIcons[$notify['cachetype']]['iconSet'][1]['iconSmall'], $mailbody);
        $mailbody = mb_ereg_replace('{thunderSection}', $thunderSection, $mailbody);
        $subject = mb_ereg_replace('{cachename}', $notify['cachename'], $mailsubject);
        /* begin send out everything that has to be sent */
        $email_headers = "Content-Type: text/html; charset=utf-8\r\n";
        $email_headers .= 'From: "' . $mailfrom . '" <' . $mailfrom . '>';
        // mail versenden
        if ($debug == true) {
            $mailadr = $debug_mailto;
        } else {
            $mailadr = $notify['email'];
        }
        //header("Content-Type: text/html; charset=utf-8\r\n");
        //echo $mailbody;
        $status = mb_send_mail($mailadr, $subject, $mailbody, $email_headers);
        // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
        logentry('notify_newcache', 5, $notify['recid'], $notify['cache_id'], 0, 'Sending mail to ' . $mailadr, array('status' => $status));
    } else {
        echo "Unbekannter Notification-Typ: " . $notify['type'] . "<br />";
    }
    return 0;
}
Exemple #4
0
    $rsUser = sql("SELECT user_id FROM user WHERE user_id='&1'", $newuserid);
    $rUser = sql_fetch_assoc($rsUser);
    sql_free_result($rsUser);
    if ($rCache === false) {
        die('Cache existiert nicht!');
    }
    if ($rUser === false) {
        die('User existiert nicht!');
    }
    sql("UPDATE caches SET user_id='&1' WHERE cache_id='&2'", $rUser['user_id'], $rCache['cache_id']);
    // send event to delete statpic
    event_change_statpic($rCache['user_id']);
    event_change_statpic($rUser['user_id']);
    echo 'Besitzer geändert';
    // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
    logentry('approving', 4, 0, $cacheid, 0, 'Owner changed ' . $cacheid, '');
    exit;
} elseif ($action == 'showcache') {
    $wp = isset($_REQUEST['waypoint']) ? $_REQUEST['waypoint'] : 0;
    $newusername = isset($_REQUEST['newusername']) ? $_REQUEST['newusername'] : 0;
    $cacheid = sqlValue("SELECT cache_id FROM caches WHERE wp_oc='" . sql_escape($wp) . "'", 0);
    $userid = sqlValue("SELECT user_id FROM user WHERE username='******'", '');
    if ($cacheid == 0) {
        die('Cache nicht gefunden!');
    }
    if ($userid == 0) {
        die('User nicht gefunden!');
    }
    $rsUser = sql("SELECT user_id, username FROM user WHERE user_id='&1'", $userid);
    $rUser = sql_fetch_assoc($rsUser);
    sql_free_result($rsUser);
Exemple #5
0
function process_owner_log($user_id, $log_id)
{
    global $dblink, $logowner_text;
    //	echo "process_owner_log($user_id, $log_id)\n";
    $rsLog = sql("SELECT cache_logs.cache_id cache_id, cache_logs.text text, cache_logs.text_html text_html, cache_logs.date logdate, user.username username, caches.name cachename FROM `cache_logs`, `user`, `caches` WHERE (cache_logs.user_id = user.user_id) AND (cache_logs.cache_id = caches.cache_id) AND (cache_logs.id ='&1')", $log_id);
    $rLog = sql_fetch_array($rsLog);
    mysql_free_result($rsLog);
    $watchtext = $logowner_text;
    $logtext = $rLog['text'];
    if ($rLog['text_html'] != 0) {
        $logtext = html_entity_decode($logtext, ENT_COMPAT, 'UTF-8');
        $h2t =& new html2text($logtext);
        $logtext = $h2t->get_text();
        /*
        		$logtext = html_entity_decode($logtext, ENT_COMPAT, 'UTF-8');
        		$logtext = mb_ereg_replace("\r", '', $logtext);
        		$logtext = mb_ereg_replace("\n", '', $logtext);
        		$logtext = mb_ereg_replace('</p>', "</p>\n", $logtext);
        		$logtext = mb_ereg_replace('<br/>', "<br/>\n", $logtext);
        		$logtext = mb_ereg_replace('<br />', "<br />\n", $logtext);
        		$logtext = strip_tags($logtext);
        */
    }
    $watchtext = mb_ereg_replace('{date}', date('d.m.Y', strtotime($rLog['logdate'])), $watchtext);
    $watchtext = mb_ereg_replace('{cacheid}', $rLog['cache_id'], $watchtext);
    $watchtext = mb_ereg_replace('{text}', $logtext, $watchtext);
    $watchtext = mb_ereg_replace('{user}', $rLog['username'], $watchtext);
    $watchtext = mb_ereg_replace('{cachename}', $rLog['cachename'], $watchtext);
    sql("INSERT IGNORE INTO watches_waiting (`user_id`, `object_id`, `object_type`, `date_created`, `watchtext`, `watchtype`) VALUES (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'&1', '&2', 1, NOW(), '&3', 1)", $user_id, $log_id, $watchtext);
    // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
    logentry('watchlist', 1, $user_id, $log_id, 0, $watchtext, array());
}
    echo '<FONT  COLOR="red"  SIZE=+2  FACE="Arial"><STRONG>';
    $errbuf = "Apotheke Bestellung ";
    switch ($passtag) {
        case 1:
            $errbuf = $errbuf . "Falsche Eingabe";
            echo '<img src=../img/cat-fe.gif >';
            break;
        case 2:
            $errbuf = $errbuf . "Keine Berechtigung";
            echo '<img src=../img/cat-noacc.gif >';
            break;
        default:
            $errbuf = $errbuf . "Zugang gesperrt";
            echo '<img src=../img/cat-sperr.gif >';
    }
    logentry($userid, $keyword, $errbuf, $thisfile, $fileforward);
    echo '</STRONG></FONT><P>';
}
?>

<table  border=0 cellpadding=0 cellspacing=0>
<tr>
<?php 
if (!$passtag) {
    echo '
<td>

<img src="../img/ned2r.gif" border=0 width=100 height=138 >
</td>
';
}
Exemple #7
0
function process_owner_log($user_id, $log_id)
{
    global $opt, $dblink, $translate;
    //	echo "process_owner_log($user_id, $log_id)\n";
    $rsLog = sql("SELECT\n\t\t\t`cache_logs`.`cache_id`,\n\t\t\t`cache_logs`.`type`,\n\t\t\t`cache_logs`.`text`,\n\t\t\t`cache_logs`.`text_html`,\n\t\t\t`cache_logs`.`date` `logdate`,\n\t\t\t`cache_logs`.`needs_maintenance`,\n\t\t\t`cache_logs`.`listing_outdated`,\n\t\t\t`user`.`username`,\n\t\t\t`caches`.`name` `cachename`,\n\t\t\t`caches`.`wp_oc`\n\t\tFROM\n\t\t\t`cache_logs`,\n\t\t\t`user`,\n\t\t\t`caches`\n\t\tWHERE\n\t\t\t`cache_logs`.`user_id`=`user`.`user_id` AND\n\t\t\t`cache_logs`.`cache_id`=`caches`.`cache_id` AND\n\t\t\t`cache_logs`.`id` ='&1'", $log_id);
    $rLog = sql_fetch_array($rsLog);
    mysql_free_result($rsLog);
    $logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0, EMAIL_LINEWRAP);
    $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null);
    if (!$language) {
        $language = $opt['template']['default']['locale'];
    }
    if (strpos($rLog['logdate'], '00:00:00') > 0) {
        $dateformat = $opt['locale'][$language]['format']['phpdate'];
    } else {
        $dateformat = $opt['locale'][$language]['format']['phpdatetime'];
    }
    $watchtext = '{date} ' . $translate->t('{user} has logged your cache "{cachename}":', '', basename(__FILE__), __LINE__, '', 1, $language) . ' {action}{maintenance_flags}' . "\n" . '{shortlink_url}{wp_oc}' . "\n\n" . '{text}' . "\n\n\n\n";
    $watchtext = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['logdate'])), $watchtext);
    $watchtext = mb_ereg_replace('{wp_oc}', $rLog['wp_oc'], $watchtext);
    $watchtext = mb_ereg_replace('{text}', $logtext, $watchtext);
    $watchtext = mb_ereg_replace('{user}', $rLog['username'], $watchtext);
    $watchtext = mb_ereg_replace('{cachename}', $rLog['cachename'], $watchtext);
    $watchtext = mb_ereg_replace('{action}', get_logtype_name($rLog['type'], $language), $watchtext);
    $watchtext = insert_maintenance_flags($rLog, $language, $watchtext);
    $domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null);
    $urls = get_site_urls($domain);
    if ($urls['shortlink_url']) {
        $watchtext = mb_ereg_replace("{shortlink_url}", $urls['shortlink_url'], $watchtext);
    } else {
        $watchtext = mb_ereg_replace("{shortlink_url}", $urls['site_url'], $watchtext);
    }
    sql("INSERT IGNORE INTO `watches_waiting` \n            (`user_id`, `object_id`, `object_type`, `date_created`, `watchtext`, `watchtype`) \n        VALUES ('&1', '&2', 1, NOW(), '&3', 1)", $user_id, $log_id, $watchtext);
    // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
    logentry('watchlist', 1, $user_id, $log_id, 0, $watchtext, array());
}
 private function sendEmail($step, $cacheid)
 {
     $octeamEmailAddress = $this->ocConfig->getOcteamEmailAddress();
     $siteName = $this->ocConfig->getSiteName();
     $cache = new \lib\Objects\GeoCache\GeoCache(array('cacheId' => (int) $cacheid));
     switch ($step) {
         case $this->step["START"]:
             $email_content = read_file($this->stylepath . '/email/arch1.email');
             break;
         case $this->step["AFTER_FIRST_MAIL_SENT"]:
             $email_content = read_file($this->stylepath . '/email/arch2.email');
             break;
         case $this->step["AFTER_SECOND_MAIL_SENT"]:
             $email_content = read_file($this->stylepath . '/email/arch3.email');
             break;
     }
     $email_content = mb_ereg_replace('{server}', $this->ocConfig->getAbsolute_server_URI(), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_01}', tr('autoArchive_01'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_02}', tr('autoArchive_02'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_03}', tr('autoArchive_03'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_04}', tr('autoArchive_04'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_05}', tr('autoArchive_05'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_06}', tr('autoArchive_06'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_07}', tr('autoArchive_07'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_08}', tr('autoArchive_08'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_09}', tr('autoArchive_09'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_10}', tr('autoArchive_10'), $email_content);
     $email_content = mb_ereg_replace('{cachename}', $cache->getCacheName(), $email_content);
     $email_content = mb_ereg_replace('{cache_wp}', $cache->getWaypointId(), $email_content);
     $email_content = mb_ereg_replace('{cacheid}', $cacheid, $email_content);
     $email_content = mb_ereg_replace('{octeamEmailsSignature}', $this->ocConfig->getOcteamEmailsSignature(), $email_content);
     $emailheaders = "Content-Type: text/plain; charset=utf-8\r\n";
     $emailheaders .= "From: {$siteName} <{$octeamEmailAddress}>\r\n";
     $emailheaders .= "Reply-To: {$siteName} <{$octeamEmailAddress}>";
     $status = mb_send_mail($cache->getOwner()->getEmail(), tr('autoArchive_11'), $email_content, $emailheaders);
     logentry('autoarchive', 6, $cache->getOwner()->getUserId(), $cache->getCacheId(), 0, 'Sending mail to ' . $cache->getOwner()->getEmail(), array('status' => $status));
 }
function send_mail_and_clean_watches_waiting($currUserID, $currUserName, $currUserEMail, $currUserOwnerLogs, $currUserWatchLogs)
{
    global $nologs, $debug, $debug_mailto, $mailfrom, $mailsubject, $absolute_server_URI, $octeamEmailsSignature;
    if ($currUserID == '') {
        return;
    }
    $email_headers = 'MIME-Version: 1.0' . "\r\n";
    $email_headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
    $email_headers .= 'From: "' . $mailfrom . '" <' . $mailfrom . '>';
    $mailbody = read_file(dirname(__FILE__) . '/watchlist.email.html');
    $mailbody = mb_ereg_replace('{username}', $currUserName, $mailbody);
    $mailbody = mb_ereg_replace('{absolute_server_URI}', $absolute_server_URI, $mailbody);
    if ($currUserOwnerLogs != '') {
        $logtexts = $currUserOwnerLogs;
        while (mb_substr($logtexts, -1) == "\n" || mb_substr($logtexts, -1) == "\r") {
            $logtexts = mb_substr($logtexts, 0, mb_strlen($logtexts) - 1);
        }
        $mailbody = mb_ereg_replace('{ownerlogs}', $logtexts, $mailbody);
        $mailbody = mb_ereg_replace('{cachesOwnedDisplay}', 'block', $mailbody);
    } else {
        $mailbody = mb_ereg_replace('{ownerlogs}', $nologs, $mailbody);
        $mailbody = mb_ereg_replace('{cachesOwnedDisplay}', 'none', $mailbody);
    }
    if ($currUserWatchLogs != '') {
        $logtexts = $currUserWatchLogs;
        while (mb_substr($logtexts, -1) == "\n" || mb_substr($logtexts, -1) == "\r") {
            $logtexts = mb_substr($logtexts, 0, mb_strlen($logtexts) - 1);
        }
        $mailbody = mb_ereg_replace('{watchlogs}', $logtexts, $mailbody);
        $mailbody = mb_ereg_replace('{cachesWatchedDisplay}', 'block', $mailbody);
    } else {
        $mailbody = mb_ereg_replace('{watchlogs}', $nologs, $mailbody);
        $mailbody = mb_ereg_replace('{cachesWatchedDisplay}', 'none', $mailbody);
    }
    $mailbody = mb_ereg_replace('{runwatch01}', tr('runwatch01'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch02}', tr('runwatch02'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch03}', tr('runwatch03'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch04}', tr('runwatch04'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch05}', tr('runwatch05'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch06}', tr('runwatch06'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch07}', tr('runwatch07'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch08}', tr('runwatch08'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch09}', tr('runwatch09'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch10}', tr('runwatch10'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch11}', tr('runwatch11'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch12}', tr('runwatch12'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch13}', tr('runwatch13'), $mailbody);
    $mailbody = mb_ereg_replace('{runwatch14}', tr('runwatch14'), $mailbody);
    $mailbody = mb_ereg_replace('{emailSign}', $octeamEmailsSignature, $mailbody);
    if ($debug == true) {
        $mailadr = $debug_mailto;
    } else {
        $mailadr = $currUserEMail;
    }
    // $mailbody;
    $status = mb_send_mail($mailadr, $mailsubject, $mailbody, $email_headers);
    // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
    logentry('watchlist', 2, $currUserID, 0, 0, 'Sending mail to ' . $mailadr, array('status' => $status));
    // entries entfernen
    sql("DELETE FROM watches_waiting WHERE user_id='&1' AND watchtype IN (1, 2)", $currUserID);
}
            //echo '<img '.createLDImgSrc($root_path,'cat-fe.gif','0','left').'>';
            break;
        case 2:
            $errbuf = "{$errbuf} {$LDNoAuth}";
            $err_msg = "<div class=\"warnprompt\">{$LDNoAuth}</div><br>{$LDPlsContactEDP}";
            //echo '<img '.createLDImgSrc($root_path,'cat-noacc.gif','0','left').'>';
            break;
        default:
            $errbuf = "{$errbuf} {$LDAuthLocked}";
            $err_msg = "<div class=\"warnprompt\">{$LDAuthLocked}</div><br>{$LDPlsContactEDP}";
            //echo '<img '.createLDImgSrc($root_path,'cat-sperr.gif','0','left').'>';
    }
    #
    # Log auth attempt
    #
    logentry($userid, "PW ({$keyword})", "{$REMOTE_ADDR} {$errbuf}", $thisfile, $fileforward);
    $smarty->assign('bShowErrorPrompt', TRUE);
    $smarty->assign('sMascotImg', '<img ' . createMascot($root_path, 'mascot1_r.gif', '0') . '>');
    $smarty->assign('sErrorMsg', $err_msg);
}
if (!$passtag) {
    $smarty->assign('sMascotColumn', '<td><img ' . createMascot($root_path, 'mascot3_r.gif', '0') . '></td>');
}
#
# Prepare the auth entry form elements
#
$smarty->assign('sPassFormParams', 'action="' . $thisfile . '" method="post" name="passwindow" onSubmit="return pruf(this);"');
$smarty->assign('LDPwNeeded', $LDPwNeeded);
$smarty->assign('LDUserPrompt', $LDUserPrompt);
$smarty->assign('LDPwPrompt', $LDPwPrompt);
#
    tpl_set_var('message', '');
    if (isset($_REQUEST['submit'])) {
        $username = isset($_REQUEST['username']) ? $_REQUEST['username'] : '';
        $rs = sql("SELECT `user_id`, `email`, `username` FROM `user` WHERE `username`='&1'", $username);
        if (mysql_num_rows($rs) == 0) {
            tpl_set_var('username', htmlspecialchars($username, ENT_COMPAT, 'UTF-8'));
            tpl_set_var('username_message', $wrong_username);
        } else {
            $r = sql_fetch_array($rs);
            $email_content = read_file($stylepath . '/email/remindemail.email');
            $email_content = mb_ereg_replace('{server}', $absolute_server_URI, $email_content);
            $email_content = mb_ereg_replace('{ForgottenEmail_07}', tr('ForgottenEmail_07'), $email_content);
            $email_content = mb_ereg_replace('{ForgottenEmail_08}', tr('ForgottenEmail_08'), $email_content);
            $email_content = mb_ereg_replace('{ForgottenEmail_09}', tr('ForgottenEmail_09'), $email_content);
            $email_content = mb_ereg_replace('{ForgottenEmail_10}', tr('ForgottenEmail_10'), $email_content);
            $email_content = mb_ereg_replace('{ForgottenEmail_11}', tr('ForgottenEmail_11'), $email_content);
            $email_content = mb_ereg_replace('{user}', $r['username'], $email_content);
            $email_content = mb_ereg_replace('{date}', strftime($datetimeformat), $email_content);
            $email_content = mb_ereg_replace('{email}', $r['email'], $email_content);
            $email_content = mb_ereg_replace('{octeamEmailsSignature}', $octeamEmailsSignature, $email_content);
            // ok, mail verschicken
            mb_send_mail($r['email'], $mail_subject, $email_content, $emailheaders);
            // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
            logentry('remindemail', 3, $r['user_id'], 0, 0, 'Remind-E-Mail-Adress an ' . sql_escape($r['username']) . ' / ' . sql_escape($r['email']), array());
            tpl_set_var('username', htmlspecialchars($username, ENT_COMPAT, 'UTF-8'));
            tpl_set_var('message', $mail_send);
        }
    }
}
//make the template and send it out
tpl_BuildTemplate();
Exemple #12
0
            $logbackup['desc'][] = $r;
            sql("INSERT INTO removed_objects (`localid`, `uuid`, `type`, `removed_date`, `node`) VALUES ('&1', '&2', 3, NOW(), '&3')", $r['id'], $r['uuid'], $oc_nodeid);
            sql("DELETE FROM `cache_desc` WHERE `id`='&1' LIMIT 1", $r['id']);
        }
        // Cache
        $rs = sql("SELECT * FROM `caches` WHERE `cache_id`='&1' LIMIT 1", $cacheid);
        while ($r = sql_fetch_assoc($rs)) {
            $logbackup['caches'][] = $r;
            sql("INSERT INTO removed_objects (`localid`, `uuid`, `type`, `removed_date`, `node`) VALUES ('&1', '&2', 2, NOW(), '&3')", $r['cache_id'], $r['uuid'], $oc_nodeid);
            sql("DELETE FROM `caches` WHERE `cache_id`='&1' LIMIT 1", $r['cache_id']);
            // send event to delete statpic
            event_change_statpic($r['user_id']);
        }
        echo 'Cache gelöscht';
        // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
        logentry('approving', 4, 0, $cacheid, 0, 'Totaly removed Cache ' . $cacheid, $logbackup);
        exit;
    } else {
        if ($action == 'showcache') {
            $cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0;
            $rs = sql("SELECT `caches`.`cache_id` `cacheid`, `caches`.`name` `name`, `cache_status`.`pl` `status`, `caches`.`longitude` `longitude`, `caches`.`latitude` `latitude` FROM `caches`, `cache_status` WHERE `caches`.`status`=`cache_status`.`id` AND `caches`.`cache_id`='&1' LIMIT 1", $cacheid);
            if (mysql_num_rows($rs) != 0) {
                $r = sql_fetch_assoc($rs);
                mysql_free_result($rs);
                ?>
            <html>
                <body>
                    <form action="cache.php" method="get">

                    </form>
                    <table>
Exemple #13
0
function process_owner_log($user_id, $log_id)
{
    global $opt, $dblink, $translate;
    //	echo "process_owner_log($user_id, $log_id)\n";
    $rsLog = sql("SELECT cache_logs.cache_id cache_id, cache_logs.type, cache_logs.text text, cache_logs.text_html text_html, cache_logs.date logdate, user.username username, caches.name cachename, caches.wp_oc wp_oc FROM `cache_logs`, `user`, `caches` WHERE (cache_logs.user_id = user.user_id) AND (cache_logs.cache_id = caches.cache_id) AND (cache_logs.id ='&1')", $log_id);
    $rLog = sql_fetch_array($rsLog);
    mysql_free_result($rsLog);
    $logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0);
    $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null);
    if (!$language) {
        $language = $opt['template']['default']['locale'];
    }
    if (strpos($rLog['logdate'], '00:00:00') > 0) {
        $dateformat = $opt['locale'][$language]['format']['phpdate'];
    } else {
        $dateformat = $opt['locale'][$language]['format']['phpdatetime'];
    }
    $watchtext = '{date} ' . $translate->t('{user} has logged your cache "{cachename}":', '', basename(__FILE__), __LINE__, '', 1, $language) . ' {action}' . "\n" . 'http://opencaching.de/{wp_oc}' . "\n\n" . '{text}' . "\n\n\n\n";
    $watchtext = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['logdate'])), $watchtext);
    $watchtext = mb_ereg_replace('{wp_oc}', $rLog['wp_oc'], $watchtext);
    $watchtext = mb_ereg_replace('{text}', $logtext, $watchtext);
    $watchtext = mb_ereg_replace('{user}', $rLog['username'], $watchtext);
    $watchtext = mb_ereg_replace('{cachename}', $rLog['cachename'], $watchtext);
    $watchtext = mb_ereg_replace('{action}', get_logtype_name($rLog['type'], $language), $watchtext);
    sql("INSERT IGNORE INTO watches_waiting (`user_id`, `object_id`, `object_type`, `date_created`, `watchtext`, `watchtype`) VALUES (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'&1', '&2', 1, NOW(), '&3', 1)", $user_id, $log_id, $watchtext);
    // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
    logentry('watchlist', 1, $user_id, $log_id, 0, $watchtext, array());
}
Exemple #14
0
if ($ergebnis = $db->Execute($sql)) {
    $zeile = $ergebnis->FetchRow();
    if (isset($checkintern) && $checkintern) {
        $dec_login = new Crypt_HCEMD5($key_login, '');
        //$keyword = $dec_login->DecodeMimeSelfRand($HTTP_COOKIE_VARS['ck_login_pw'.$sid]);
        $keyword = $dec_login->DecodeMimeSelfRand($HTTP_SESSION_VARS['sess_login_pw']);
    } else {
        $checkintern = false;
    }
    if ($zeile['password'] == md5($keyword) && $zeile['login_id'] == $userid) {
        if (!$zeile['lockflag']) {
            if (isset($screenall) && $screenall || validarea($zeile['permission'])) {
                if (empty($zeile['name'])) {
                    $zeile['name'] = ' ';
                }
                logentry($userid, $zeile['name'], "IP:" . $REMOTE_ADDR . " {$lognote} ", $thisfile, $fileforward);
                /**
                 * Init crypt to use 2nd level key and encrypt the sid.
                 * Store to cookie the "$ck_2level_sid.$sid"
                 * There is no need to call another include of the inc_init_crypt.php since it is already included at the start 
                 * of the script that called this script.
                 */
                $enc_2level = new Crypt_HCEMD5($key_2level, makeRand());
                $ciphersid = $enc_2level->encodeMimeSelfRand($sid);
                //setcookie('ck_2level_sid'.$sid,$ciphersid,time()+3600,'/');
                //setcookie($userck.$sid,$zeile['name'],time()+3600,'/');
                setcookie('ck_2level_sid' . $sid, $ciphersid, 0, '/');
                setcookie($userck . $sid, $zeile['name'], 0, '/');
                //setcookie('ck_2level_sid'.$sid,$ciphersid);
                //setcookie($userck.$sid,$zeile['name']);
                //echo $fileforward;
function aktualisiereTabellen2()
{
    require_once "php/Functions.php";
    initDBConnection();
    global $db;
    $vorhandeneVersion = DBGetProperty(DBPTabVersion, 0);
    echo "<p>Vorhandene Version: " . $vorhandeneVersion . ", Zielversion: " . DBPTabVersionRequired . "</p>\n";
    if (DBGetProperty(DBPTabVersion, 0) < 50) {
        ergebnis(false, "Tabellenaktualisierung", "", "nicht möglich. Bitte nutzen Sie " . actionLink("erzeugeTabellen") . ".");
    }
    if (DBGetProperty(DBPTabVersion, 0) == 50) {
        if (dbctDBTabProtocol()) {
            ergebnis(DBSetProperty(DBPTabVersion, "51"), "Tabellenversion 51", "gespeichert", "nicht gespeichert: " . mysql_error($db));
        }
    }
    if (DBGetProperty(DBPTabVersion, 0) == "51") {
        if (dbctDBTabopenid()) {
            ergebnis(DBSetProperty(DBPTabVersion, "52"), "Tabellenversion 52", "gespeichert", "nicht gespeichert: " . mysql_error($db));
        }
    }
    if (DBGetProperty(DBPTabVersion, 0) == "52") {
        $q = "ALTER TABLE " . DBTabUsers . " ADD PRIMARY KEY ( `ID` );";
        ergebnis($erg = mysql_query($q, $db), "Änderung der Struktur (Primärschlüssel aktivieren) an Tabelle " . DBTabUsers, "erfolgreich", "nicht erfolgreich: " . mysql_error($db) . "<br />" . htmlentities($q));
        $q = "ALTER TABLE " . DBTabUsers . " MODIFY ID mediumint(9) NOT NULL auto_increment;";
        ergebnis($erg = $erg && mysql_query($q, $db), "Änderung der Struktur (auto_increment für Spalte ID) an Tabelle " . DBTabUsers, "erfolgreich", "nicht erfolgreich: " . mysql_error($db) . "<br />" . htmlentities($q));
        if ($erg) {
            ergebnis(DBSetProperty(DBPTabVersion, "53"), "Tabellenversion 53", "gespeichert", "nicht gespeichert: " . mysql_error($db));
        }
    }
    if (DBGetProperty(DBPTabVersion, 0) == "53") {
        $q = "ALTER TABLE " . DBTabProtocol . " ADD Level tinyint unsigned AFTER Datum;";
        ergebnis($erg = mysql_query($q, $db), "Änderung der Struktur (Spalte Level) an Tabelle " . DBTabProtocol, "erfolgreich", "nicht erfolgreich: " . mysql_error($db) . "<br />" . htmlentities($q));
        if ($erg) {
            ergebnis(DBSetProperty(DBPTabVersion, "54"), "Tabellenversion 54", "gespeichert", "nicht gespeichert: " . mysql_error($db));
        }
    }
    if (DBGetProperty(DBPTabVersion, 0) == "54") {
        $q = "ALTER TABLE " . DBTabProtocol . " MODIFY Level tinyint unsigned NOT NULL, MODIFY Nickname varchar(64) NOT NULL;";
        ergebnis($erg = mysql_query($q, $db), "Änderung der Struktur (Spalte Level) an Tabelle " . DBTabProtocol, "erfolgreich", "nicht erfolgreich: " . mysql_error($db) . "<br />" . htmlentities($q));
        if ($erg) {
            ergebnis(DBSetProperty(DBPTabVersion, "55"), "Tabellenversion 55", "gespeichert", "nicht gespeichert: " . mysql_error($db));
        }
    }
    logentry(LogDebug, "SQL-Admin", "config.php", "Datenbankversion 55 erreicht");
    echo actionLink("cfgTest");
}