ilchClan-v1.1-userCP/UPLOAD/contents/ucp.php

100 lines
2.8 KiB
PHP
Raw Normal View History

<?php
# Copyright: Marcel 'H4ckHunt3r 'Naeve
## Support: www.naeve.info && www.ilch.de
defined('main') or die('no direct access');
$title = $allgAr['title'].' :: User Control Panel';
$hmenu = 'UserCP';
$design = new design ( $title , $hmenu );
$design->header();
$ucpVersion = "1.1.0.2";
// Versions Kontrolle
if($allgAr['ucp_vctrl']=='1')
{
if(is_admin ())
{
try{
$handle = @fopen("https://forgejo.nae.one/manae/ilchClan-v1.1-userCP/raw/branch/main/version.txt", "r");
$content = @fread($handle, 7);
$aVers = split('[/.-]', $ucpVersion);
$nVers = split('[/.-]', $content);
$updateMessage = 'Eine neue UserCP Version ist verf&uuml;gbar.<br>Download auf: <a href="https://forgejo.nae.one/manae/ilchClan-v1.1-userCP">forgejo.nae.one/manae/ilchClan-v1.1-userCP</a>!<hr>';
if($aVers[0]<$nVers[0]){
echo $updateMessage;
} elseif($aVers[0]==$nVers[0] && $aVers[1]<$nVers[1]) {
echo $updateMessage;
} elseif($aVers[0]==$nVers[0] && $aVers[1]==$nVers[1] && $aVers[2]<$nVers[2]) {
echo $updateMessage;
} elseif($aVers[0]==$nVers[0] && $aVers[1]==$nVers[1] && $aVers[2]==$nVers[2] && $aVers[3]<$nVers[3]) {
echo $updateMessage;
}
} catch (Exception $e)
{
echo 'Die Pr&uuml;fung der Version ist Fehlgeschlagen.<br>
'.$e->getMessage().'<hr>';
}
}
}
// ---------------------
if($_SESSION['authid']!=0)
{
$uid = escape($_SESSION['authid'],"integer");
$kqU = db_fetch_object(db_query("SELECT * FROM prefix_user WHERE id='".$uid."'"));
if(file_exists($kqU->userpic))
{
$upic = $kqU->userpic;
} else {
$upic = "include/images/userpics/0.jpg";
}
$tpl = new tpl('ucp/main.htm');
$uIarr = array(
'upic' => $upic,
'ava' => $kqU->avatar,
'name' => $kqU->name
);
$tpl->set_ar_out($uIarr,0);
$message = "";
switch($menu->get(1))
{
case'contact': include_once("include/contents/ucp/contact.php"); break;
case'ava': include_once("include/contents/ucp/ava.php"); break;
case'upic': include_once("include/contents/ucp/upic.php"); break;
case'info': include_once("include/contents/ucp/info.php"); break;
case'safe': include_once("include/contents/ucp/safe.php"); break;
case'sig': include_once("include/contents/ucp/sig.php"); break;
case'sets': include_once("include/contents/ucp/settings.php"); break;
case'fields': include_once("include/contents/ucp/fields.php"); break;
default: include_once("include/contents/ucp/main.php"); break;
}
$tpl = new tpl('ucp/main.htm');
if($menu->get(1)!='main' && $menu->get(1)!="")
{
$tpl->set('back','<div style="width:98%; text-align:right;"><a href="index.php?ucp">Zur UserCP Hauptseite</a></div>');
}else{
$tpl->set('back','');
}
$tpl->out(2);
} else {
print '<hr>Sie m&uuml;ssen eingeloggt sein um Ihre Daten &auml;ndern zu k&ouml;nnen!<hr>';
}
$design->footer();
?>