public function main()
 {
     $page = Request::get(0, VAR_URI);
     if (preg_match('/^(\\d+)-/', $page, $matches) > 0 && !empty($matches[1])) {
         $airlineData = new CustomData($this->airlinePage->getPosition());
         if ($airlineData->load($matches[1])) {
             $uri = AirlineTools::buildUri($airlineData->getId(), $airlineData->getData('name'), true);
             $this->flightPage->setBaseUri($uri);
             $this->breadcrumb->add($airlineData->getData('name'), URI::build($uri));
             $flight = Request::get(1, VAR_INT);
             if (is_id($flight)) {
                 $this->flight($flight);
             } else {
                 $this->airline($matches[1]);
             }
         } else {
             $this->header();
             $this->notFoundError();
             $this->footer();
         }
     } else {
         $this->header();
         $this->airlinePage->overview('/Airlines/categories');
         $this->footer();
     }
 }
 public function setPerPage($pp)
 {
     if (is_id($pp)) {
         $this->perPage = $pp;
     } else {
         $this->perPage = 10;
     }
 }
Пример #3
0
 public function patch()
 {
     $this->model->id = (int) $this->app->request->uri->segment(1);
     $this->model->name = trim($this->app->request->params->post['name']);
     $this->model->price = trim($this->app->request->params->post['price']);
     if (!is_id($this->model->id) || $this->model->name == '' || $this->model->price == '') {
         $this->app->response->setStatus(Status::BAD_REQUEST);
         return;
     }
     if (!$this->model->find()) {
         $this->app->response->setStatus(Status::NOT_FOUND);
         return;
     }
     $result = $this->model->save();
     if (is_int($result)) {
         return ['ok' => true, 'id' => $this->model->id];
     }
     return ['ok' => false, 'id' => null];
 }
 function initAdmin($dir = null)
 {
     global $admconfig, $my;
     if (!empty($my->settings['default_language'])) {
         $dir = $my->settings['default_language'];
     } elseif (is_id($admconfig['default_language'])) {
         $dir = $admconfig['default_language'];
     }
     if ($dir != null) {
         $this->setdir($dir);
     }
     $this->group('settings');
     $this->group('admin/global');
     $this->group('modules');
     $this->group('custom');
     @ini_set('default_charset', '');
     if (!headers_sent()) {
         viscacha_header('Content-type: text/html; charset=' . $this->charset());
     }
 }
function get_remote($file)
{
    if (!class_exists('Snoopy')) {
        include 'classes/class.snoopy.php';
    }
    if (!preg_match('/^(http:\\/\\/)([\\wäöüÄÖÜ@\\-_\\.]+)\\:?([0-9]*)\\/(.*)$/', $file, $url_ary)) {
        return REMOTE_INVALID_URL;
    }
    $snoopy = new Snoopy();
    if (is_id($url_ary[3])) {
        $snoopy->port = $url_ary[3];
    } else {
        $snoopy->port = null;
    }
    $status = $snoopy->fetch($file);
    if ($status == true) {
        return $snoopy->results;
    } else {
        return REMOTE_CLIENT_ERROR;
    }
}
 function load()
 {
     global $db, $gpc;
     if ($this->exists() == true) {
         $this->import();
     } else {
         $this->data = array();
         $result = $db->query("SELECT id, name FROM {$db->pre}user", __LINE__, __FILE__);
         while ($row = $db->fetch_assoc($result)) {
             $this->data[$row['id']] = $gpc->prepare($row['name']);
         }
         $olduserdata = file('data/deleteduser.php');
         foreach ($olduserdata as $row) {
             $row = trim($row);
             if (!empty($row)) {
                 $row = explode("\t", $row);
                 if (is_id($row[0])) {
                     $this->data[$row[0]] = $row[1];
                 }
             }
         }
         $this->export();
     }
 }
Пример #7
0
        $error[] = $lang->phrase('editprofile_fullname_incorrect');
    }
    if (count($error) > 0) {
        error($error, "editprofile.php?action=profile" . SID2URL_x);
    } else {
        // Now we create the birthday...
        if (!$_POST['birthmonth'] && !$_POST['birthday'] && !$_POST['birthyear']) {
            $bday = '0000-00-00';
        } else {
            $_POST['birthmonth'] = leading_zero($_POST['birthmonth']);
            $_POST['birthday'] = leading_zero($_POST['birthday']);
            $_POST['birthyear'] = leading_zero($_POST['birthyear'], 4);
            $bday = $_POST['birthyear'] . '-' . $_POST['birthmonth'] . '-' . $_POST['birthday'];
        }
        $_POST['icq'] = str_replace('-', '', $_POST['icq']);
        if (!is_id($_POST['icq'])) {
            $_POST['icq'] = 0;
        }
        if ($config['changename_allowed'] == 1) {
            $changename = ", name = '{$_POST['name']}'";
        } else {
            $changename = '';
        }
        $db->query("UPDATE {$db->pre}user SET icq = '{$_POST['icq']}', yahoo = '{$_POST['yahoo']}', aol = '{$_POST['aol']}', msn = '{$_POST['msn']}', jabber = '{$_POST['jabber']}', birthday = '{$bday}', gender = '{$_POST['gender']}', hp = '{$_POST['hp']}', signature = '{$_POST['signature']}', location = '{$_POST['location']}', fullname = '{$_POST['fullname']}', mail = '{$_POST['email']}'{$changename} WHERE id = '{$my->id}' LIMIT 1", __LINE__, __FILE__);
        ok($lang->phrase('data_success'), "editprofile.php?action=profile" . SID2URL_x);
    }
} elseif ($_GET['action'] == "settings") {
    $breadcrumb->Add($lang->phrase('editprofile_settings'));
    echo $tpl->parse("header");
    echo $tpl->parse("menu");
    $design = cache_loaddesign();
Пример #8
0
             if ($vword->check_session($_POST['captcha'], $_POST['letter']) == FALSE) {
                 $error[] = $lang->phrase('veriword_mistake');
             } else {
                 $human = array('captcha' => $_POST['captcha'], 'letter' => $_POST['letter']);
             }
         } else {
             $error[] = $lang->phrase('veriword_failed');
         }
     }
     if (!check_mail($_POST['email']) && ($config['guest_email_optional'] == 0 || !empty($_POST['email']))) {
         $error[] = $lang->phrase('illegal_mail');
     }
     if (double_udata('name', $_POST['name']) == false) {
         $error[] = $lang->phrase('username_registered');
     }
     if (is_id($_POST['name'])) {
         $error[] = $lang->phrase('username_registered');
     }
     if (strxlen($_POST['name']) > $config['maxnamelength']) {
         $error[] = $lang->phrase('name_too_long');
     }
     if (strxlen($_POST['name']) < $config['minnamelength']) {
         $error[] = $lang->phrase('name_too_short');
     }
     if (strxlen($_POST['email']) > 200) {
         $error[] = $lang->phrase('email_too_long');
     }
     $pname = $_POST['name'];
     $pnameid = $_POST['name'];
     $pid = 0;
 } else {
/**
 * Function that updates the user and session data after the script finished.
 */
function updatelogged () {
	global $my, $db, $gpc, $plugins;
	if (!isset($my->pwfaccess) || !is_array($my->pwfaccess)) {
		$my->pwfaccess = array();
	}
	if (!isset($my->settings) || !is_array($my->settings)) {
		$my->settings = array();
	}
	if (!isset($my->mark) || !is_array($my->mark)) {
		$my->mark = array();
	}
	$serialized = $db->escape_string(serialize($my->mark));
	$serializedpwf = $db->escape_string(serialize($my->pwfaccess));
	$serializedstg = $db->escape_string(serialize($my->settings));
	$sqlwhere = $sqlset = array();
	if ($my->id > 0 && !is_id($this->change_mid)) {
		$sqlwhere[] = "mid = '{$my->id}'";
	}
	else {
		$sqlwhere[] = "sid = '{$this->sid}'";
	}
	$action = $gpc->get('action', str);
	$qid = $gpc->get('id', int);

	if (is_id($this->change_mid)) {
		$sqlset[] = "mid = '{$this->change_mid}'";
	}

	($code = $plugins->load('permissions_updatelogged_query')) ? eval($code) : null;

	$sqlset = iif(count($sqlset) > 0, ', ').implode(', ', $sqlset);
	$sqlwhere2 = implode(', ', $sqlwhere);

	if (count($sqlwhere) > 0) {
		$db->query ("
		UPDATE {$db->pre}session
		SET mark = '{$serialized}', wiw_script = '".SCRIPTNAME."', wiw_action = '{$action}', wiw_id = '{$qid}', active = '".time()."',
			pwfaccess = '{$serializedpwf}', settings = '{$serializedstg}', lastvisit = '{$my->clv}' {$sqlset}
		WHERE {$sqlwhere2}
		LIMIT 1
		");
	}

	if ($my->vlogin) {
		// Eigentlich könnten wir uns das Updaten der User-Lastvisit-Spalte sparen, für alle User die Cookies nutzen. Einmal, am Anfang der Session würde dann reichen
		$db->query("UPDATE {$db->pre}user SET lastvisit = '".time()."'  WHERE id = '{$my->id}'");
	}

}
Пример #10
0
        if (!isset($ratings[$row->id])) {
            $ratings[$row->id] = array();
        }
        if ($my->vlogin && $my->id != $row->mid && !isset($ratings[$row->id][$my->id])) {
            $showrating = true;
        }
        $ratingcounter = count($ratings[$row->id]);
        if (count($ratings[$row->id]) > 0) {
            $row->rating = round(array_sum($ratings[$row->id]) / $ratingcounter * 50) + 50;
        }
    }
    ($code = $plugins->load('showtopic_entry_prepared')) ? eval($code) : null;
    $inner['index_bit'][] = $tpl->parse("showtopic/index_bit");
    ($code = $plugins->load('showtopic_entry_added')) ? eval($code) : null;
}
if ($my->vlogin && is_id($info['id'])) {
    $result = $db->query("SELECT id, type FROM {$db->pre}abos WHERE mid = '{$my->id}' AND tid = '{$info['id']}'");
    $abox = $db->fetch_assoc($result);
} else {
    $abox = array('id' => null, 'type' => null);
}
$inner['index_bit'] = implode('', $inner['index_bit']);
($code = $plugins->load('showtopic_prepared')) ? eval($code) : null;
echo $tpl->parse("showtopic/index");
$slog->setTopicRead($info['id'], $topforums);
($code = $plugins->load('showtopic_end')) ? eval($code) : null;
$slog->updatelogged();
$zeitmessung = t2();
echo $tpl->parse("footer");
$phpdoc->Out();
$db->close();
Пример #11
0
 while ($row = $gpc->prepare($db->fetch_object($result))) {
     $pref = '';
     $showprefix = false;
     if (isset($prefix_arr[$row->prefix]) && $row->prefix > 0) {
         $prefix = $prefix_arr[$row->prefix]['value'];
         $showprefix = true;
     } else {
         $prefix = '';
     }
     if (is_id($row->name) && isset($memberdata[$row->name])) {
         $row->mid = $row->name;
         $row->name = $memberdata[$row->name];
     } else {
         $row->mid = FALSE;
     }
     if (is_id($row->last_name) && isset($memberdata[$row->last_name])) {
         $row->last_name = $memberdata[$row->last_name];
     }
     $rstart = str_date('d.m.Y H:i', times($row->date));
     $rlast = str_date('d.m.Y H:i', times($row->last));
     if ($row->status == '2') {
         $pref .= $lang->phrase('forum_moved');
     } else {
         if (empty($row->mark) && !empty($info['auto_status'])) {
             $row->mark = $info['auto_status'];
         }
         if ($row->mark == 'n') {
             $pref .= 'News: ';
         } elseif ($row->mark == 'a') {
             $pref .= 'Artcle: ';
         } elseif ($row->mark == 'b') {
Пример #12
0
}
echo "- Database class loaded and initialized.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->savedata();
echo "- Configuration updated.<br />";
// Languages
$ini = array('settings' => array('language_de' => array('compatible_version' => VISCACHA_VERSION), 'language' => array('compatible_version' => VISCACHA_VERSION)), 'admin/frames' => array('language_de' => array('admin_scheduler_log' => 'Protokoll der geplanten Aufgaben')), 'classes' => array('language_de' => array('mailer_encoding' => 'Unbekanntes Encoding-Format: ', 'mailer_execute' => 'Konnte folgenden Befehl nicht ausf&uuml;hren: ', 'mailer_file_access' => 'Zugriff auf folgende Datei fehlgeschlagen: ', 'mailer_file_open' => 'Datei Fehler: Konnte folgende Datei nicht &ouml;ffnen: ', 'mailer_from_failed' => 'Die folgende Absenderadresse ist nicht korrekt: ', 'mailer_recipients_failed' => 'SMTP Fehler: Die folgenden Empf&auml;nger sind nicht korrekt: ', 'mailer_signing' => 'Fehler beim Signieren: ', 'mailer_empty_message' => 'E-Mail Inhalt ist leer.', 'mailer_invalid_address' => 'E-Mail wird nicht gesendet, die Adresse ist ung&uuml;ltig.', 'mailer_smtp_connect_failed' => 'Verbindung zu SMTP Server fehlgeschlagen.', 'mailer_smtp_error' => 'Fehler vom SMTP Server: ', 'mailer_variable_set' => 'Kann Variable nicht setzen oder zur&uuml;cksetzen: '), 'language' => array('mailer_authenticate' => 'SMTP Error: Could not authenticate.', 'mailer_connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'mailer_data_not_accepted' => 'SMTP Error: Data not accepted.', 'mailer_encoding' => 'Unknown encoding: ', 'mailer_execute' => 'Could not execute: ', 'mailer_file_access' => 'Could not access file: ', 'mailer_file_open' => 'File Error: Could not open file: ', 'mailer_from_failed' => 'The following From address failed: ', 'mailer_instantiate' => 'Could not instantiate mail function.', 'mailer_mailer_not_supported' => ' mailer is not supported.', 'mailer_provide_address' => 'You must provide at least one recipient email address.', 'mailer_recipients_failed' => 'SMTP Error: The following recipients failed: ', 'mailer_empty_message' => 'Message body empty', 'mailer_invalid_address' => 'Invalid address', 'mailer_smtp_connect_failed' => 'SMTP Connect() failed.', 'mailer_smtp_error' => 'SMTP server error: ', 'mailer_variable_set' => 'Cannot set or reset variable: ')), 'global' => array('language_de' => array('digest_d' => 'Tägliche E-Mail-Benachrichtigung', 'digest_none' => 'Keine Benachrichtigung', 'img_captcha_session_expired_error' => 'Seite aktualisieren', 'digest_f' => 'Nur Favorit'), 'language' => array('digest_none' => 'No notification', 'img_captcha_session_expired_error' => 'Refresh page', 'digest_f' => 'Favorite only')));
updateLanguageFiles($ini);
echo "- Language files updated.<br />";
$newCss = file_get_contents('temp/standard.css');
$dir = dir('designs');
while (false !== ($entry = $dir->read())) {
    if (is_id($entry)) {
        $path = "{$dir->path}/{$entry}/standard.css";
        $css = file_get_contents($path);
        if (!empty($css)) {
            $css .= $newCss;
            if (!$filesystem->file_put_contents($path, $css)) {
                $css = null;
            }
        }
        if (empty($css)) {
            echo "<br />!!! <strong>Warning:</strong> Updating {$path} failed. Plase add the following CSS code to your main css file in designs/{$entry}:<br /><code>";
            echo htmlentities($newCss);
            echo "</code><br /><br />";
        }
    }
}
function BoardSelect($board = 0)
{
    global $config, $my, $tpl, $db, $gpc, $lang, $scache, $plugins, $slog;
    $found = false;
    $sub_cache = $forum_cache = $last_cache = $forums = $cat = array();
    $categories_obj = $scache->load('categories');
    $cat_cache = $categories_obj->get();
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    $index_moderators = $scache->load('index_moderators');
    $mod_cache = $index_moderators->get();
    $prefix_obj = $scache->load('prefix');
    $prefix = $prefix_obj->get();
    ($code = $plugins->load('forums_query')) ? eval($code) : null;
    // Fetch Forums
    $result = $db->query("\n\tSELECT\n\t\tf.id, f.name, f.description, f.opt, f.optvalue, f.parent, f.topics, f.replies, f.last_topic, f.invisible,\n\t\tt.topic as l_topic, t.prefix AS l_prefix, t.id as l_tid, t.last as l_date, u.name AS l_uname, t.last_name AS l_name, f.id AS l_bid\n\tFROM {$db->pre}forums AS f\n\t\tLEFT JOIN {$db->pre}topics AS t ON f.last_topic=t.id\n\t\tLEFT JOIN {$db->pre}user AS u ON t.last_name=u.id\n\tORDER BY f.parent, f.position\n\t");
    $keys = array('l_prefix' => null, 'l_topic_full' => null, 'l_topic' => null, 'l_tid' => null, 'l_date' => null, 'l_uname' => null, 'l_name' => null, 'l_bid' => null);
    while ($row = $db->fetch_assoc($result)) {
        $row['name'] = $gpc->prepare($row['name']);
        $row['l_uname'] = $gpc->prepare($row['l_uname']);
        $row['l_name'] = $gpc->prepare($row['l_name']);
        $row['bid'] = $cat_cache[$row['parent']]['parent'];
        // Caching for Subforums
        if (!empty($row['bid'])) {
            $sub_cache[$row['bid']][] = $row;
        }
        // Caching the Forums
        if ($row['bid'] == $board) {
            $forum_cache[$row['parent']][] = $row;
        }
        $last_cache[$row['id']] = $row;
        ($code = $plugins->load('forums_caching')) ? eval($code) : null;
    }
    $cats = array();
    $hidden = 0;
    // Work with the chached data!
    foreach ($cat_cache as $cat) {
        $cat['forums'] = array();
        if (isset($forum_cache[$cat['id']]) == false) {
            continue;
        }
        foreach ($forum_cache[$cat['id']] as $forum) {
            $found = true;
            $forum['new'] = false;
            $forum['show'] = true;
            // Subforendaten vererben (Letzter Beitrag, Markierung)
            if (isset($sub_cache[$forum['id']])) {
                $substats = SubStats($forum['topics'], $forum['replies'], $forum['id'], $sub_cache);
                $forum['topics'] = $substats[0];
                $forum['replies'] = $substats[1];
            }
            // Letzter Beitrag
            $last = $last_cache[$forum['id']];
            if (isset($sub_cache[$forum['id']])) {
                foreach ($substats[2] as $last_bid) {
                    $sub = $last_cache[$last_bid];
                    if ($last['l_date'] < $sub['l_date'] && check_forumperm($sub)) {
                        $last = $sub;
                    }
                }
            }
            $forum = array_merge($forum, array_intersect_key($last, $keys));
            if (is_id($forum['l_name']) && isset($memberdata[$forum['l_name']])) {
                $forum['l_name'] = array($forum['l_uname'], $forum['l_name']);
            } else {
                $forum['l_name'] = array($forum['l_name'], 0);
            }
            // Rechte und Gelesensystem
            if ($forum['opt'] != 're') {
                if (!check_forumperm($forum)) {
                    if ($forum['invisible'] != 0) {
                        $forum['show'] = false;
                    }
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['state'] = BOARD_STATE_LOCKED;
                    $forum['topics'] = '-';
                    $forum['replies'] = '-';
                    $forum['l_topic'] = false;
                    $forum['l_topic_full'] = '';
                } else {
                    if ($slog->isForumRead($forum['id'], $forum['l_date']) || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                        $forum['state'] = BOARD_STATE_OLD;
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['state'] = BOARD_STATE_NEW;
                        $forum['new'] = true;
                    }
                    if (!empty($forum['l_topic'])) {
                        if (isset($prefix[$forum['id']][$forum['l_prefix']]) && $forum['l_prefix'] > 0) {
                            $lang->assign('prefix', $prefix[$forum['id']][$forum['l_prefix']]['value']);
                            $forum['l_prefix'] = $lang->phrase('showtopic_prefix_title');
                        } else {
                            $forum['l_prefix'] = '';
                        }
                        if (strxlen($forum['l_topic']) > $config['lasttopic_chars']) {
                            $forum['l_topic_full'] = $forum['l_prefix'] . $forum['l_topic'];
                            $forum['l_topic'] = subxstr($forum['l_topic'], 0, $config['lasttopic_chars']);
                            $forum['l_topic'] .= "...";
                        } else {
                            $forum['l_topic_full'] = '';
                        }
                        $forum['l_date'] = str_date($lang->phrase('dformat1'), times($forum['l_date']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replies'] = numbers($forum['replies']);
            // Moderatoren
            $forum['mod'] = array();
            if (isset($mod_cache[$forum['id']])) {
                $anz2 = count($mod_cache[$forum['id']]);
                for ($i = 0; $i < $anz2; $i++) {
                    if ($anz2 != $i + 1) {
                        $mod_cache[$forum['id']][$i]['sep'] = ', ';
                    } else {
                        $mod_cache[$forum['id']][$i]['sep'] = '';
                    }
                    $forum['mod'][] = $mod_cache[$forum['id']][$i];
                }
            }
            // Unterforen
            $forum['sub'] = array();
            if ($config['showsubfs']) {
                if (isset($sub_cache[$forum['id']])) {
                    $anz2 = count($sub_cache[$forum['id']]);
                    $sub = array();
                    for ($i = 0; $i < $anz2; $i++) {
                        $show = true;
                        $sub_cache[$forum['id']][$i]['new'] = false;
                        if ($sub_cache[$forum['id']][$i]['opt'] != 're') {
                            if (!check_forumperm($sub_cache[$forum['id']][$i])) {
                                if ($sub_cache[$forum['id']][$i]['invisible'] != 0) {
                                    $show = false;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_locked');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_LOCKED;
                                }
                            } else {
                                if ($slog->isForumRead($sub_cache[$forum['id']][$i]['id'], $sub_cache[$forum['id']][$i]['l_date']) || $sub_cache[$forum['id']][$i]['topics'] < 1) {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_open');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_OLD;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_red');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_NEW;
                                    $sub_cache[$forum['id']][$i]['new'] = true;
                                }
                            }
                        } else {
                            $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_redirect');
                            $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_WWW;
                        }
                        if ($show == true) {
                            $forum['sub'][] = $sub_cache[$forum['id']][$i];
                        }
                    }
                }
            }
            ($code = $plugins->load('forums_entry_prepared')) ? eval($code) : null;
            if ($forum['show'] == true) {
                $cat['forums'][] = $forum;
            } elseif ($forum['invisible'] != 2) {
                $hidden++;
            }
        }
        if (count($cat['forums']) > 0) {
            $cats[] = $cat;
        }
    }
    ($code = $plugins->load('forums_prepared')) ? eval($code) : null;
    $error_state = count($cats) == 0 && $board == 0;
    if (count($cats) > 0 || $error_state) {
        $tpl->globalvars(compact("cats", "board", "hidden", "error_state"));
        echo $tpl->parse("categories");
    }
    // Else: This is a forum without sub forums (that should be displayed)
    return $found;
}
Пример #14
0
    echo $lang->phrase('admin_cms_form_edit');
    ?>
"></td>
  </tr>
 </table>
</form>
<?php 
    echo foot();
} elseif ($job == 'feed_edit2') {
    echo head();
    $title = $gpc->get('temp1', str);
    $file = $gpc->get('temp2', db_esc);
    $entries = $gpc->get('value', int);
    $id = $gpc->get('id', int);
    $max_age = $gpc->get('max_age', int);
    if (!is_id($id)) {
        error('admin.php?action=cms&job=feed', $lang->phrase('admin_cms_invalid_id_given'));
    }
    if (empty($title)) {
        error('admin.php?action=cms&job=feed_edit&id=' . $id, $lang->phrase('admin_cms_no_title_specified'));
    }
    if (empty($file)) {
        error('admin.php?action=cms&job=feed_edit&id=' . $id, $lang->phrase('admin_cms_no_url_specified'));
    }
    if (empty($entries)) {
        $entries = 0;
    }
    if (empty($max_age)) {
        $max_age = 60 * 12;
    }
    $db->query("UPDATE {$db->pre}grab SET file = '{$file}', title = '{$title}', entries = '{$entries}', max_age = '{$max_age}' WHERE id = '{$id}'");
function getDocLangID($data)
{
    global $my, $config;
    if (isset($my->language) && is_id($my->language) && isset($data[$my->language])) {
        return $my->language;
        // Best case: Language specified by the user
    } elseif (is_id($config['doclang']) && isset($data[$config['doclang']])) {
        return $config['doclang'];
        // Normal Case: Standard language specified for documents
    } elseif (is_id($config['langdir']) && isset($data[$config['langdir']])) {
        return $config['langdir'];
        // Worse Case: Standard language of the page
    } else {
        reset($data);
        return key($data);
        // Worst Case: Take another language... let's say just the first in the list?!
    }
}
Пример #16
0
        $query['pic'] = '';
    }
    if (count($error) > 0) {
        error('admin.php?action=members&job=edit&id=' . $query['id'], $error);
    } else {
        // Now we create the birthday...
        if (!$query['birthmonth'] && !$query['birthday'] && !$query['birthyear']) {
            $bday = '0000-00-00';
        } else {
            $query['birthmonth'] = leading_zero($query['birthmonth']);
            $query['birthday'] = leading_zero($query['birthday']);
            $query['birthyear'] = leading_zero($query['birthyear'], 4);
            $bday = $query['birthyear'] . '-' . $query['birthmonth'] . '-' . $query['birthday'];
        }
        $query['icq'] = str_replace('-', '', $query['icq']);
        if (!is_id($query['icq'])) {
            $query['icq'] = 0;
        }
        $pw = $gpc->get('pw', none);
        if (!empty($pw) && strlen($pw) >= $config['minpwlength']) {
            $md5 = md5($pw);
            $update_sql = ", pw = '{$md5}' ";
        } else {
            $update_sql = ' ';
        }
        $db->query("UPDATE {$db->pre}user SET groups = '" . $query['groups'] . "', timezone = '" . $query['temp'] . "', opt_textarea = '" . $query['opt_0'] . "', opt_pmnotify = '" . $query['opt_1'] . "', opt_hidebad = '" . $query['opt_2'] . "', opt_hidemail = '" . $query['opt_3'] . "', template = '" . $query['opt_4'] . "', language = '" . $query['opt_5'] . "', pic = '" . $query['pic'] . "', about = '" . $query['comment'] . "', icq = '" . $query['icq'] . "', yahoo = '" . $query['yahoo'] . "', aol = '" . $query['aol'] . "', msn = '" . $query['msn'] . "', jabber = '" . $query['jabber'] . "', birthday = '" . $bday . "', gender = '" . $query['gender'] . "', hp = '" . $query['hp'] . "', signature = '" . $query['signature'] . "', location = '" . $query['location'] . "', fullname = '" . $query['fullname'] . "', mail = '" . $query['email'] . "', name = '" . $query['name'] . "'" . $update_sql . " WHERE id = '" . $user['id'] . "' LIMIT 1", __LINE__, __FILE__);
        ok("admin.php?action=members&job=manage", 'Daten erfolgreich gespeichert!');
    }
} elseif ($job == 'delete') {
    echo head();
    $delete = $gpc->get('delete', arr_int);
Пример #17
0
" /></td>
  </tr>
  <?php 
    }
    ?>
  <tr>
   <td class="ubox" colspan="2" align="center"><input type="submit" name="Submit" value="Save" /></td>
  </tr>
 </table>
</form>
	<?php 
    echo foot();
} elseif ($job == 'package_updates') {
    $id = $gpc->get('id', int);
    echo head();
    if (is_id($id)) {
        $result = $db->query("SELECT internal, version FROM {$db->pre}packages WHERE id = '{$id}'");
        $data = $db->fetch_assoc($result);
        if (empty($data['version'])) {
            error('admin.php?action=packages&job=package', $lang->phrase('admin_packages_err_no_information_about_the_current_version_found'));
        }
        $pb = $scache->load('package_browser');
        $row = $pb->getOne(IMPTYPE_PACKAGE, $data['internal']);
        if ($row !== false && !empty($row['version'])) {
            if (version_compare($row['version'], $data['version'], '>')) {
                ok('admin.php?action=packages&job=browser_detail&id=' . $row['internal'] . '&package=' . IMPTYPE_PACKAGE, $lang->phrase('admin_packages_ok_there_is_a_new_version_foo_on_the_server'), 3000);
            } else {
                ok('admin.php?action=packages&job=package_info&id=' . $id, $lang->phrase('admin_packages_ok_this_package_seems_to_be_up_to_date'), 3000);
            }
            break;
        }
Пример #18
0
    $furl = $https . $server_name . '/' . $source;
}
if (empty($config['forenmail']) == false) {
    $email = $config['forenmail'];
} elseif (isset($_SERVER['SERVER_ADMIN'])) {
    $email = $_SERVER['SERVER_ADMIN'];
} else {
    $email = '';
}
// Determine path to script
$fpath = !empty($config['fpath']) ? $config['fpath'] : str_replace('\\', '/', realpath('./'));
$langarr = array();
$d = dir('language/');
while (false !== ($entry = $d->read())) {
    $dir = $d->path . DIRECTORY_SEPARATOR . $entry;
    if (is_id($entry) && is_dir($dir)) {
        $name = getLangNameByPath($dir);
        $langarr[$entry] = $name;
    }
}
$d->close();
?>
<div class="bbody">
	<input type="hidden" name="save" value="1" />
	<table class="tables">
	 <tr>
	  <td class="mbox" width="50%">Site name:<br /><span class="stext">Maximum: 64 characters</span></td>
	  <td class="mbox" width="50%"><input type="text" name="fname" value="<?php 
echo $config['fname'];
?>
" size="50" /></td>
Пример #19
0
                $row['comment'] = $bbcode->censor(trim($row['comment']));
                $data['comment'] .= "\r\n[quote" . iif(!empty($row['name']), "=" . $row['name']) . "]";
                $data['comment'] .= $row['comment'];
                $data['comment'] .= "[/quote]\r\n";
            }
        }
    }
    if ($config['botgfxtest_posts'] == 1 && is_null($data['human']) == true) {
        include "classes/graphic/class.veriword.php";
        $vword = new VeriWord();
        $veriid = $vword->set_veriword($config['botgfxtest_text_verification']);
        if ($config['botgfxtest_text_verification'] == 1) {
            $textcode = $vword->output_word($veriid);
        }
    }
    if ($my->vlogin && is_id($_GET['id'])) {
        $result = $db->query("SELECT id FROM {$db->pre}abos WHERE mid = '{$my->id}' AND tid = '{$_GET['id']}'", __LINE__, __FILE__);
        $abox = $db->fetch_assoc($result);
    } else {
        $abox = array('id' => null);
    }
    $inner['smileys'] = $bbcode->getsmileyhtml($config['smileysperrow']);
    $inner['bbhtml'] = $bbcode->getbbhtml();
    echo $tpl->parse("header");
    echo $tpl->parse("menu");
    ($code = $plugins->load('addreply_form_prepared')) ? eval($code) : null;
    echo $tpl->parse("addreply");
    ($code = $plugins->load('addreply_form_end')) ? eval($code) : null;
}
($code = $plugins->load('addreply_end')) ? eval($code) : null;
$slog->updatelogged();
function getViscachaCHMODs()
{
    $chmod = array(array('path' => '.htaccess', 'chmod' => CHMOD_WR, 'recursive' => false, 'req' => false), array('path' => 'admin/backup', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => false), array('path' => 'admin/data/bbcode_test.php', 'chmod' => CHMOD_WR, 'recursive' => false, 'req' => false), array('path' => 'admin/data/config.inc.php', 'chmod' => CHMOD_WR, 'recursive' => false, 'req' => false), array('path' => 'admin/data/hooks.txt', 'chmod' => CHMOD_WR, 'recursive' => false, 'req' => false), array('path' => 'admin/html', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => true), array('path' => 'data', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => true), array('path' => 'data/cron', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => true), array('path' => 'data', 'chmod' => CHMOD_WR, 'recursive' => true, 'req' => true), array('path' => 'cache', 'chmod' => CHMOD_EX, 'recursive' => true, 'req' => true), array('path' => 'cache', 'chmod' => CHMOD_WR, 'recursive' => true, 'req' => false), array('path' => 'classes/cron/jobs', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => false), array('path' => 'classes/feedcreator', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => false), array('path' => 'classes/fonts', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => false), array('path' => 'classes/geshi', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => false), array('path' => 'classes/graphic/noises', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => false), array('path' => 'feeds', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => true), array('path' => 'feeds', 'chmod' => CHMOD_WR, 'recursive' => true, 'req' => true), array('path' => 'images', 'chmod' => CHMOD_EX, 'recursive' => true, 'req' => false), array('path' => 'modules', 'chmod' => CHMOD_EX, 'recursive' => true, 'req' => false), array('path' => 'modules', 'chmod' => CHMOD_WR, 'recursive' => true, 'req' => false), array('path' => 'temp', 'chmod' => CHMOD_EX, 'recursive' => true, 'req' => true), array('path' => 'templates', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => true), array('path' => 'uploads', 'chmod' => CHMOD_EX, 'recursive' => true, 'req' => true));
    $path = 'language';
    $dh = opendir($path);
    while ($file = readdir($dh)) {
        $fullpath = $path . '/' . $file;
        if ($file != '.' && $file != '..' && is_id($file) && is_dir($fullpath)) {
            $chmod[] = array('path' => $fullpath . '/modules', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => false);
            $chmod[] = array('path' => $fullpath, 'chmod' => CHMOD_WR, 'recursive' => true, 'req' => false);
        }
    }
    closedir($dh);
    $path = 'templates';
    $dh = opendir($path);
    while ($file = readdir($dh)) {
        $fullpath = $path . '/' . $file;
        if ($file != '.' && $file != '..' && is_id($file) && is_dir($fullpath)) {
            $chmod[] = array('path' => $fullpath, 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => false);
            $chmod[] = array('path' => $fullpath . '/modules', 'chmod' => CHMOD_EX, 'recursive' => false, 'req' => false);
            $chmod[] = array('path' => $fullpath, 'chmod' => CHMOD_WR, 'recursive' => true, 'req' => false);
        }
    }
    closedir($dh);
    $path = 'designs';
    $dh = opendir($path);
    while ($file = readdir($dh)) {
        $fullpath = $path . '/' . $file;
        if ($file != '.' && $file != '..' && is_id($file) && is_dir($fullpath)) {
            $dh2 = opendir($fullpath);
            while ($file = readdir($dh2)) {
                $stylesheet = $fullpath . '/' . $file;
                if (preg_match('~\\.css$~i', $file)) {
                    $chmod[] = array('path' => $stylesheet, 'chmod' => CHMOD_WR, 'recursive' => false, 'req' => false);
                }
            }
            closedir($dh2);
            $chmod[] = array('path' => $fullpath, 'chmod' => CHMOD_EX, 'recursive' => true, 'req' => false);
        }
    }
    closedir($dh);
    return $chmod;
}
Пример #21
0
    $my->p = $slog->Permissions();
    if (check_hp($_SERVER['HTTP_REFERER'])) {
        $url = parse_url($_SERVER['HTTP_REFERER']);
        if (strpos($config['furl'], $url['host']) !== FALSE) {
            $loc = htmlspecialchars($_SERVER['HTTP_REFERER']);
        }
    }
    if (empty($loc)) {
        $loc = 'javascript:history.back(-1);';
    }
    $slog->mark_read();
    ok($lang->phrase('marked_as_read'), $loc);
} elseif ($_GET['action'] == "markforumasread") {
    $board = $gpc->get('board', int);
    $my->p = $slog->Permissions($board);
    if (!is_id($board) || $my->p['forum'] == 0) {
        errorLogin();
    }
    $result = $db->query('SELECT id FROM ' . $db->pre . 'topics WHERE board = ' . $board . ' AND last > ' . $my->clv, __LINE__, __FILE__);
    while ($row = $db->fetch_assoc($result)) {
        $my->mark['t'][$row['id']] = time();
    }
    $my->mark['f'][$board] = time();
    $slog->updatelogged();
    ok($lang->phrase('marked_as_read'), 'showforum.php?id=' . $board);
} elseif ($_GET['action'] == "rules") {
    $my->p = $slog->Permissions();
    $breadcrumb->Add($lang->phrase('rules_title'));
    echo $tpl->parse("header");
    echo $tpl->parse("menu");
    $rules = $lang->get_words('rules');
Пример #22
0
    $sub = $_REQUEST['sub'];
}
require 'install/classes/function.chmod.php';
require 'install/classes/class.tar.php';
$tar = new tar(realpath('install/files/'), $tar_packs[$sub]);
$tar->ignore_chmod();
$error = $tar->extract_files('./');
$files = implode("\n", $tar->list_files());
$dirs = array('language' => null, 'templates' => null, 'designs' => null, 'images' => null);
preg_match_all('~^(' . implode('|', array_keys($dirs)) . ')/(\\d+)/([^\\n]+)$~m', $files, $replicable, PREG_SET_ORDER);
foreach ($replicable as $rep) {
    if ($dirs[$rep[1]] === null) {
        $dirs[$rep[1]] = array();
        $dir = dir($rep[1]);
        while (false !== ($entry = $dir->read())) {
            if (is_id($entry) && is_dir($rep[1] . '/' . $entry)) {
                $dirs[$rep[1]][$entry] = $rep[1] . '/' . $entry . '/';
            }
        }
        $dir->close();
    }
    $content = file_get_contents($rep[0]);
    foreach ($dirs[$rep[1]] as $path) {
        $target = $path . $rep[3];
        if (file_exists($target)) {
            $filesystem->chmod($target, 0666);
        } elseif (!@is_dir(dirname($target))) {
            $filesystem->mkdir(dirname($target), 0777);
        }
        $filesystem->file_put_contents($target, $content);
    }
function BoardSelect($board = 0)
{
    global $config, $my, $tpl, $db, $gpc, $lang, $scache, $plugins;
    $found = false;
    $sub_cache = array();
    $sub_cache_last = array();
    $cat_cache = array();
    $mod_cache = array();
    $forum_cache = array();
    $categories_obj = $scache->load('categories');
    $cat_cache = $categories_obj->get();
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    $index_moderators = $scache->load('index_moderators');
    $mod_cache = $index_moderators->get();
    ($code = $plugins->load('forums_query')) ? eval($code) : null;
    // Fetch Forums
    $result = $db->query("SELECT \n    \tc.id, c.name, c.desc, c.opt, c.optvalue, c.bid, c.topics, c.replys, c.cid, c.last_topic, c.invisible,  \n    \tt.topic as btopic, t.id as btopic_id, t.last as bdate, u.name AS uname, t.last_name AS bname\n    FROM {$db->pre}cat AS c\n        LEFT JOIN {$db->pre}topics AS t ON c.last_topic=t.id \n        LEFT JOIN {$db->pre}user AS u ON t.last_name=u.id \n    ORDER BY c.cid, c.c_order, c.id", __LINE__, __FILE__);
    if ($db->num_rows($result) == 0) {
        $errormsg = array('There are currently no boards to show. Pleas visit the <a href="admin.php' . SID2URL_1 . '">Admin Control Panel</a> and create some forums.');
        $errorurl = '';
        $tpl->globalvars(compact("errorurl", "errormsg"));
        echo $tpl->parse('main/error');
        return $found;
    }
    while ($row = $db->fetch_assoc($result)) {
        $gpc->prepare($row['name']);
        $gpc->prepare($row['btopic']);
        $gpc->prepare($row['uname']);
        $gpc->prepare($row['bname']);
        // Caching for Subforums
        if ($row['bid'] > 0) {
            $sub_cache[$row['bid']][] = $row;
            $sub_cache_last[$row['id']] = $row;
        }
        // Caching the Forums
        if ($row['bid'] == $board) {
            $forum_cache[$row['cid']][] = $row;
        }
        ($code = $plugins->load('forums_caching')) ? eval($code) : null;
    }
    // Work with the chached data!
    foreach ($cat_cache as $cat) {
        $forums = array();
        if (isset($forum_cache[$cat['id']]) == false) {
            continue;
        }
        foreach ($forum_cache[$cat['id']] as $forum) {
            $found = true;
            $forum['new'] = false;
            $forum['show'] = true;
            $forum['mbdate'] = $forum['bdate'];
            // Subforendaten vererben (Letzter Beitrag, Markierung)
            if (isset($sub_cache[$forum['id']])) {
                $substats = SubStats($forum['topics'], $forum['replys'], $forum['id'], $sub_cache);
                $forum['topics'] = $substats[0];
                $forum['replys'] = $substats[1];
                $bids = $substats[2];
            }
            $last = $forum['last_topic'];
            $last_date = $forum['bdate'];
            if (isset($sub_cache[$forum['id']])) {
                foreach ($bids as $bidf) {
                    $sub = $sub_cache_last[$bidf];
                    if ($last_date < $sub['bdate']) {
                        $last = $sub['id'];
                        $last_date = $sub['bdate'];
                    }
                }
            }
            $forum['lname'] = is_id($forum['bname']) ? $forum['uname'] : $forum['bname'];
            if ($last != $forum['last_topic']) {
                $forum['id2'] = $last;
                $forum['last_topic'] = $sub_cache_last[$forum['id2']]['last_topic'];
                $forum['btopic_id'] = $sub_cache_last[$forum['id2']]['btopic_id'];
                $forum['btopic'] = $sub_cache_last[$forum['id2']]['btopic'];
                $forum['bdate'] = $sub_cache_last[$forum['id2']]['bdate'];
                if (!isset($sub_cache_last[$forum['id2']]['lname'])) {
                    $forum['lname'] = is_id($sub_cache_last[$forum['id2']]['bname']) ? $sub_cache_last[$forum['id2']]['uname'] : $sub_cache_last[$forum['id2']]['bname'];
                } else {
                    $forum['lname'] = $sub_cache_last[$forum['id2']]['lname'];
                }
            } else {
                $forum['id2'] = $forum['id'];
            }
            $id = array_search(trim($forum['lname']), $memberdata);
            if (is_id($id)) {
                $forum['lname'] = array($forum['lname'], $id);
            } else {
                $forum['lname'] = array($forum['lname'], 0);
            }
            if ($forum['btopic_id']) {
                $forum['tid'] = $forum['btopic_id'];
            } else {
                $forum['tid'] = $forum['last_topic'];
            }
            // Rechte und Gelesensystem
            if ($forum['opt'] != 're') {
                if (!check_forumperm($forum)) {
                    if ($forum['invisible'] == 1) {
                        $forum['show'] = false;
                    }
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['topics'] = '-';
                    $forum['replys'] = '-';
                    $forum['btopic'] = false;
                } else {
                    if (isset($my->mark['f'][$forum['id']]) && $my->mark['f'][$forum['id']] > $forum['bdate'] || $forum['bdate'] < $my->clv || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['new'] = true;
                    }
                    if ($forum['btopic']) {
                        if (strxlen($forum['btopic']) >= 40) {
                            $forum['btopic'] = substr($forum['btopic'], 0, 40);
                            $forum['btopic'] .= "...";
                        }
                        $forum['bdate'] = str_date($lang->phrase('dformat1'), times($forum['bdate']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replys'] = numbers($forum['replys']);
            // Moderatoren
            $forum['mod'] = array();
            if (isset($mod_cache[$forum['id']])) {
                $anz2 = count($mod_cache[$forum['id']]);
                for ($i = 0; $i < $anz2; $i++) {
                    if ($anz2 != $i + 1) {
                        $mod_cache[$forum['id']][$i]['sep'] = ', ';
                    } else {
                        $mod_cache[$forum['id']][$i]['sep'] = '';
                    }
                    $forum['mod'][] = $mod_cache[$forum['id']][$i];
                }
            }
            // Unterforen
            $forum['sub'] = array();
            if ($config['showsubfs']) {
                if (isset($sub_cache[$forum['id']])) {
                    $anz2 = count($sub_cache[$forum['id']]);
                    $sub = array();
                    for ($i = 0; $i < $anz2; $i++) {
                        $show = true;
                        $sub_cache[$forum['id']][$i]['new'] = false;
                        if ($sub_cache[$forum['id']][$i]['opt'] != 're') {
                            if (!check_forumperm($sub_cache[$forum['id']][$i])) {
                                if ($sub_cache[$forum['id']][$i]['invisible'] == 1) {
                                    $show = false;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_locked');
                                }
                            } else {
                                if (isset($my->mark['f'][$sub_cache[$forum['id']][$i]['id']]) && $my->mark['f'][$sub_cache[$forum['id']][$i]['id']] > $sub_cache[$forum['id']][$i]['bdate'] || $sub_cache[$forum['id']][$i]['bdate'] < $my->clv || $sub_cache[$forum['id']][$i]['topics'] < 1) {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_open');
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_red');
                                    $sub_cache[$forum['id']][$i]['new'] = true;
                                }
                            }
                        } else {
                            $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_redirect');
                        }
                        if ($show == true) {
                            $forum['sub'][] = $sub_cache[$forum['id']][$i];
                        }
                    }
                }
            }
            ($code = $plugins->load('forums_entry_prepared')) ? eval($code) : null;
            if ($forum['show'] == true) {
                $forums[] = $forum;
            }
        }
        if (count($forums) > 0) {
            $tpl->globalvars(compact("cat", "forums"));
            ($code = $plugins->load('forums_prepared')) ? eval($code) : null;
            echo $tpl->parse("categories");
        }
    }
    return $found;
}
Пример #24
0
        $data = array('name' => $info['uid'], 'topic' => $lang->phrase('reply_prefix') . $info['topic'], 'outgoing' => 1);
        if ($_GET['action'] == 'quote') {
            $info['comment'] = str_replace('[br]', "\n", $info['comment']);
            $info['comment'] = preg_replace('/\\[hide\\](.+?)\\[\\/hide\\]/is', '', $info['comment']);
            $data['comment'] = "[quote={$info['name']}]{$info['comment']}[/quote]";
        } else {
            $data['comment'] = '';
        }
    } else {
        $data = array('name' => $_GET['name'], 'comment' => '', 'topic' => '', 'outgoing' => 1);
        if (is_id($_GET['id'])) {
            $data['name'] = $_GET['id'];
        }
    }
    ($code = $plugins->load('pm_compose_data')) ? eval($code) : null;
    if (is_id($data['name'])) {
        $memberdata_obj = $scache->load('memberdata');
        $memberdata = $memberdata_obj->get();
        if (isset($memberdata[$data['name']])) {
            $showname = $memberdata[$data['name']];
        } else {
            $data['name'] = '';
        }
    }
    echo $tpl->parse("menu");
    echo $tpl->parse("pm/menu");
    ($code = $plugins->load('pm_compose_prepared')) ? eval($code) : null;
    echo $tpl->parse("pm/new");
    ($code = $plugins->load('pm_compose_end')) ? eval($code) : null;
} elseif ($_GET['action'] == "browse") {
    $dir_name = get_pmdir($_GET['id']);
Пример #25
0
	$content = $lang->get_mail('admin_confirmed');
	xmail(array('0' => array('mail' => $row['mail'])), array(), $content['title'], $content['comment']);

	ok('admin.php?action=members&job=activate', $lang->phrase('admin_member_member_activated_completely'));
}
elseif ($job == 'ips') {
	$username = $gpc->get('username', str);
	$ipaddress = $gpc->get('ipaddress', str);
	$userid = $gpc->get('id', int);

	echo head();
	if (!empty($username)) {
		$result = $db->query("SELECT id, name FROM {$db->pre}user WHERE name = '{$username}' LIMIT 1");
		$userinfo = $db->fetch_assoc($result);
		$userid = $userinfo['id'];
		if (!is_id($userid)) {
			error('admin.php?action=members&job=ip', $lang->phrase('admin_member_invalid_user'));
		}
	}

	if (!empty($ipaddress) || $userid > 0) {
		if (!empty($ipaddress)) {
			if (check_ip($ipaddress)) {
				$hostname = @gethostbyaddr($ipaddress);
			}
			if (empty($hostname) || $hostname == $ipaddress) {
				$hostname = $lang->phrase('admin_member_could_not_resolve_hostname');
			}
			$users = $db->query("SELECT DISTINCT u.id, u.name, r.ip FROM {$db->pre}replies AS r, {$db->pre}user AS u  WHERE u.id = r.name AND r.ip LIKE '{$ipaddress}%' AND r.ip != '' ORDER BY u.name");
			?>
			<table align="center" class="border">
Пример #26
0
    }
} else {
    $error = false;
    ($code = $plugins->load('attachments_upload_start')) ? eval($code) : null;
    if ($_GET['type'] == 'addreply' && is_id($_GET['id'])) {
        $result = $db->query("SELECT id, board, name, status FROM {$db->pre}topics WHERE id = '{$_GET['id']}' LIMIT 1", __LINE__, __FILE__);
        if ($db->num_rows($result) != 1) {
            $error = true;
        }
        $upinfo = $db->fetch_assoc($result);
        $upinfo['name'] = $gpc->prepare($my->id);
        if ($upinfo['status'] != 0) {
            $error = true;
        }
        $upinfo['topic_id'] = $_GET['id'];
    } elseif ($_GET['type'] == 'newtopic' && is_id($_GET['id'])) {
        $upinfo = array('board' => $_GET['id'], 'name' => $my->id, 'topic_id' => 0, 'id' => 0);
    } elseif ($_GET['type'] == 'edit' && $_GET['id'] > 0) {
        $result = $db->query("SELECT id, board, name, topic_id FROM {$db->pre}replies WHERE id = '{$_GET['id']}' LIMIT 1", __LINE__, __FILE__);
        if ($db->num_rows($result) != 1) {
            $error = true;
        }
        $upinfo = $db->fetch_assoc($result);
        $upinfo['name'] = $gpc->prepare($upinfo['name']);
    } else {
        $error = true;
    }
    ($code = $plugins->load('attachments_upload_error')) ? eval($code) : null;
    if ($error == true) {
        echo $tpl->parse("popup/header");
        error($lang->phrase('query_string_error'), 'javascript:self.close();');
Пример #27
0
     if ($row['date'] < $base['date']) {
         $base = $row;
     }
 }
 $old = array();
 foreach ($ids as $id) {
     if ($id != $base['id']) {
         $old[] = $id;
     }
 }
 $iold = implode(',', $old);
 $topic = $cache[$_POST['topic_id']]['topic'];
 $name = $cache[$author]['name'];
 $email = $cache[$author]['email'];
 $ip = $cache[$author]['ip'];
 if (is_id($name)) {
     $guest = '0';
 } else {
     $guest = '1';
 }
 $rev = array();
 foreach ($cache as $row) {
     $row['edit'] = explode("\n", $row['edit']);
     foreach ($row['edit'] as $row2) {
         $x = trim($row2);
         if (empty($x)) {
             continue;
         }
         $row2 = explode("\t", $row2);
         $rev[] = array('name' => $row2[0], 'date' => $row2[1], 'reason' => isset($row2[2]) ? $row2[2] : '', 'ip' => isset($row2[3]) ? $row2[3] : '');
     }
 function navLang($key, $show_key = false)
 {
     global $lang, $gpc, $scache;
     if ($this->docs == null) {
         $cache = $scache->load('wraps');
         $this->docs = $cache->get();
     }
     @(list($prefix, $suffix) = explode('->', $gpc->plain_str($key, false), 2));
     $prefix = strtolower($prefix);
     if ($prefix == 'lang' && $suffix != null) {
         return $lang->phrase($suffix) . iif($show_key, " [{$key}]");
     } elseif ($prefix == 'doc' && is_id($suffix) && isset($this->docs[$suffix]['titles'])) {
         $data = $this->docs[$suffix]['titles'];
         $lid = getDocLangID($data);
         return $data[$lid] . iif($show_key, " [{$key}]");
     } else {
         return $key;
     }
 }
Пример #29
0
<?php

global $memberdata;
global $gpc;
$result = $db->query("\nSELECT t.id, t.board, t.topic, t.last AS date, t.last_name AS name\nFROM {$db->pre}topics AS t LEFT JOIN {$db->pre}cat AS c ON t.board = c.id \nWHERE c.opt != 'pw' AND t.status != '2' " . $slog->sqlinboards('t.board') . "\nORDER BY t.last DESC \nLIMIT 0," . $ini['params']['num'], __LINE__, __FILE__);
if ($db->num_rows($result) > 0) {
    if (!isset($memberdata) || !is_array($memberdata)) {
        $memberdata = cache_memberdata();
    }
    $lastbox = array();
    while ($row = $gpc->prepare($db->fetch_assoc($result))) {
        if (is_id($row['name']) && isset($memberdata[$row['name']])) {
            $row['name'] = $memberdata[$row['name']];
        }
        $row['date'] = str_date($lang->phrase('dformat1'), times($row['date']));
        if (strxlen($row['topic']) >= 75) {
            $row['topic'] = substr($row['topic'], 0, 75);
            $row['topic'] .= $lang->phrase('dot_more');
        }
        $lastbox[] = $row;
    }
    $tpl->globalvars(compact("lastbox"));
    $lang->assign('num', $ini['params']['num']);
    echo $tpl->parse($dir . "last");
}
Пример #30
0
    if ($delete == 1) {
        ?>
<input type="submit" name="submit_delete" value="Delete"><?php 
    }
    ?>
   <input type="submit" name="submit_edit" value="Edit">
   </td> 
  </tr>
 </table>
</form> 
	<?php 
    echo foot();
} elseif ($job == 'ajax_changeperm') {
    $id = $gpc->get('id', int);
    $key = $gpc->get('key', str);
    if (!is_id($id) || !isset($gls[$key])) {
        die('The id or the key is not valid!');
    }
    $result = $db->query("SELECT g.{$key}, g.core FROM {$db->pre}groups AS g WHERE id = '{$id}' LIMIT 1");
    $perm = $db->fetch_assoc($result);
    if (($key == 'admin' || $key == 'guest') && $perm['core'] == 1) {
        die('This is not allowed!');
    }
    $perm = invert($perm[$key]);
    $db->query("UPDATE {$db->pre}groups AS g SET g.{$key} = '{$perm}' WHERE id = '{$id}' LIMIT 1");
    $scache = new scache('group_status');
    $scache->deletedata();
    $scache = new scache('team_ag');
    $scache->deletedata();
    die(strval($perm));
} elseif ($job == 'add') {