当前位置: 首页>>代码示例>>PHP>>正文


PHP Core::CurrentUser方法代码示例

本文整理汇总了PHP中Core::CurrentUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Core::CurrentUser方法的具体用法?PHP Core::CurrentUser怎么用?PHP Core::CurrentUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Core的用法示例。


在下文中一共展示了Core::CurrentUser方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

 } elseif ($action == "forward") {
     if (strcasecmp(substr($subject, 0, 3), "FW:") != 0) {
         $subject = "FW: " . $subject;
     }
 }
 $text = "<p>&nbsp;</p><hr size='0' /><p><b>" . $message->FromName . "</b> to " . $message->ToName . "</p>" . $message->Text;
 if ($action == "reply") {
     $to = $names[$message->From];
     $toid = $message->From;
 } elseif ($action == "replytoall") {
     $to = array();
     $toid = array();
     $cc = array();
     $ccid = array();
     foreach ($message->To as $val) {
         if ($val != $cms->CurrentUser()->ID) {
             $to[] = $names[$val];
             $toid[] = $val;
         }
     }
     foreach ($message->CC as $val) {
         if ($val != $cms->CurrentUser()->ID) {
             $cc[] = $names[$val];
             $ccid[] = $val;
         }
     }
     $to = implode(",", $to);
     $toid = implode(",", $toid);
     $cc = implode(",", $cc);
     $ccid = implode(",", $ccid);
 }
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:mail.php

示例2: Core

<?php

require_once '../../core/core.class.php';
$core = new Core();
//Access control
//if($core->CurrentUser()->AccessRight() < 1) $core->Goto('../../php/access.php');
if ($core->CurrentUser()->Name == "Guest") {
    $core->Goto('../../php/access.php');
}
if ($core->CurrentUser()->AccessRight() == 0) {
    $action = @$_GET["action"];
    if (isset($_GET["show"])) {
        $action = "show";
    }
    if (isset($_GET["delete"])) {
        $action = "delete";
    }
    if (isset($_GET["deletecomment"])) {
        $action = "user";
    }
    if (isset($_GET["search"])) {
        $action = "user";
    }
    if (empty($action)) {
        $action = "home";
    }
} else {
    $action = @$_GET["action"];
    if (isset($_GET["show"])) {
        $action = "show";
    }
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:index.php

示例3: Core

<?php

require_once '../../core/core.class.php';
$core = new Core();
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR . "images";
if (!file_exists($path)) {
    mkdir($path);
}
$baseurl = "http://" . $_SERVER["SERVER_NAME"] . "/plugins/gallery/images/";
$names = $core->GetAllUserNames();
$action = @$_GET["action"];
if (empty($action)) {
    $action = "home";
}
if ($action == "home") {
    $result = $core->SQL("SELECT * FROM gallery WHERE \n" . $core->CurrentUser()->AccessRight() . ">=AccessRight AND AccessRight!=-1 \nAND AccessRight!=1 ORDER BY Date DESC");
} else {
    $result = $core->SQL("SELECT * FROM gallery WHERE Owner=" . $core->CurrentUser()->ID . " ORDER BY Date DESC");
}
$gallery = array();
while ($row = mysql_fetch_assoc($result)) {
    $name = $row["Owner"] . "_" . $row["id"] . "." . $row["Extension"];
    // Create thumbnail
    $thumb = $row["Owner"] . "_" . $row["id"] . "_thumb.jpg";
    if (file_exists($path . DIRECTORY_SEPARATOR . $name)) {
        if (!file_exists($path . DIRECTORY_SEPARATOR . $thumb)) {
            if ($row["Extension"] == "gif") {
                $im = @imagecreatefromgif($path . DIRECTORY_SEPARATOR . $name);
            } elseif ($row["Extension"] == "jpg") {
                $im = @imagecreatefromjpeg($path . DIRECTORY_SEPARATOR . $name);
            } elseif ($row["Extension"] == "png") {
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:gallery.rss.php

示例4: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
$ismoderator = $cms->CurrentUser()->HasPortalRole(User::MDYN_CEO) || $cms->CurrentUser()->HasPortalRole(User::MDYN_ForumModerator) || $cms->CurrentUser()->HasPortalRole(User::MDYN_Administrator) || $cms->CurrentUser()->HasEVERole(User::EVE_Director) ? 1 : 0;
$cms->assign("ismoderator", $ismoderator);
$cms->assign("pagetitle", " | Forums");
if (isset($_GET["category"]) && is_numeric(@$_GET["category"])) {
    $access = $cms->CanReadCategory($_GET["category"]);
    if ($access == 0) {
        $cms->Goto("access.php");
    }
    if ($access == 2) {
        $cms->Goto("forums.php?getcategorypassword=" . $_GET["category"]);
    }
    $page = 0;
    if (isset($_GET["page"]) && is_numeric(@$_GET["page"])) {
        $page = $_GET["page"] - 1;
    }
    $pagecount = floor($cms->ReadForumTopicCount($_GET["category"]) / 20) + 1;
    if ($pagecount < 0) {
        $pagecount = 0;
    }
    if ($page < 0) {
        $page = 0;
    }
    if ($page > $pagecount - 1) {
        $page = $pagecount - 1;
    }
    $cat = $cms->ReadForumCategory($_GET["category"]);
    $topics = $cms->ReadForumTopics($_GET["category"], $page * 20);
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:forums.php

示例5: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
if ($cms->CurrentUser()->Name == "Guest") {
    header("Location: access.php");
    exit;
}
$action = @$_GET["action"];
if (empty($action)) {
    $action = "home";
}
$result = 0;
if (isset($_GET["read"]) && is_numeric(@$_GET["read"])) {
    $note = $cms->ReadNotepad($_GET["read"]);
    $_POST["id"] = $note->ID;
    $_POST["title"] = $note->Title;
    if ($cms->IsIGB()) {
        $_POST["text"] = strip_tags($note->Text);
    } else {
        $_POST["text"] = $note->Text;
    }
    $action = "read";
} elseif ($action == "home") {
    $titles = $cms->GetNotepadTitles();
    $cms->assign("titles", $titles);
} elseif ($action == "newdone") {
    if ($_POST["submit"] == "Save") {
        if (empty($_POST["title"]) || empty($_POST["text"])) {
            $action = "new";
            $result = 1;
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:notepad.php

示例6: Core

$cms = new Core();
if ($cms->IsIGB()) {
    // Calendar
    $calendar = $cms->ReadCalendar();
    $cms->assign("calendar", $calendar);
    // Corp news
    $news = $cms->ReadNews();
    $cms->assign("news", $news);
} else {
    // Save shout
    if (isset($_GET["shout"])) {
        $cms->SaveShout($_GET["shout"]);
        $cms->Goto("home.php");
    }
    // Current user
    $user = $cms->CurrentUser();
    // Welcome message
    $article = $cms->ReadArticle(1);
    $cms->assign("welcome", $article);
    // Calendar
    $calendar = $cms->ReadCalendar();
    $cms->assign("calendar", $calendar);
    // Corp news
    $news = $cms->ReadNews();
    $cms->assign("news", $news);
    $shortnews = "";
    for ($i = 0; $i < min(count($news), 5); $i++) {
        $feed = $news[$i];
        $shortnews .= "<p><a href=\"news.php#item" . $feed->ID . "\">" . $feed->Title . "</a><br />" . substr(strip_tags($feed->Text), 0, 140) . "...</p>";
    }
    $cms->assign("shortnews", $shortnews);
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:home.php

示例7: Core

<?php

require_once '../../core/core.class.php';
$cms = new Core();
// Headers
header('Content-Type: text/xml');
echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>";
// We don't like guests here
if ($cms->CurrentUser()->IsGuest) {
    echo "<response>";
    echo "<error>Could not connect to the API server.</error>";
    echo "<training>0</training>";
    echo "<secondsleft></secondsleft>";
    echo "<skillname></skillname>";
    echo "<tolevel></tolevel>";
    echo "<endtime></endtime>";
    echo "<cacheduntil></cacheduntil>";
    echo "</response>";
    exit;
}
echo "<response>";
$result = GetSkillInTraining();
if ($result[0] == -1) {
    echo "<error>Could not connect to the API server.</error>";
    echo "<training>0</training>";
    echo "<secondsleft></secondsleft>";
    echo "<skillname></skillname>";
    echo "<tolevel></tolevel>";
    echo "<endtime></endtime>";
    echo "<cacheduntil></cacheduntil>";
} elseif ($result[0] == -2) {
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:training.xml.php

示例8: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
$action = @$_GET["action"];
if (empty($action)) {
    $action = "home";
}
$result = 0;
$isadmin = $cms->CurrentUser()->HasPortalRole(User::MDYN_CEO) || $cms->CurrentUser()->HasPortalRole(User::MDYN_Administrator) || $cms->CurrentUser()->HasEVERole(User::EVE_Director) ? 1 : 0;
$cms->assign("isadmin", $isadmin);
if ($cms->CurrentUser()->HasPortalRole(User::MDYN_CanSubmitCalendar) || $cms->CurrentUser()->AccessRight() >= 3) {
    $cms->assign("canpost", true);
}
// All corp members can post
if ($cms->CurrentUser()->AccessRight() >= 2) {
    $cms->assign("canpost", true);
}
if (isset($_GET["view"])) {
    // List all calendar entries
    $allcalendar = $cms->ReadCalendarAll();
    $calendar = array();
    foreach ($allcalendar as $item) {
        if (date("Ymd", strtotime($item->Date)) == $_GET["view"]) {
            $calendar[] = $item;
        }
    }
    $cms->assign("view", date("Y-m-d", strtotime($_GET["view"])));
    $cms->assign("calendar", $calendar);
    $action = "view";
} elseif (isset($_GET["read"]) && is_numeric(@$_GET["read"])) {
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:calendar.php

示例9: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
if ($cms->CurrentUser()->Name == "Guest") {
    header("Location: access.php");
    exit;
}
$action = @$_GET["action"];
$result = 0;
if (isset($_GET["user"]) && is_numeric(@$_GET["user"])) {
    $cms->assign('showuser', $cms->GetUserFromID($_GET["user"]));
    $cms->assign('posts', $cms->ForumRepliesByAuthor($_GET["user"]));
    $_GET["action"] = "user";
} elseif ($action == "editdone") {
    if ($_POST["submit"] == "Save") {
        $cms->EditUserInfo($_POST["timezone"], $_POST["email"], $_POST["im"], $_POST["dob_Year"] . "-" . $_POST["dob_Month"] . "-" . $_POST["dob_Day"], $_POST["location"]);
        if (!empty($_POST["apiuserid"]) && !empty($_POST["apikey"])) {
            $cms->EditUserAPIInfo($_POST["apiuserid"], $_POST["apikey"]);
        }
        $settings = 0;
        if (@$_POST["showgamenews"] == "on") {
            $settings = $settings | User::ShowGameNews;
        }
        if (@$_POST["showdevblogs"] == "on") {
            $settings = $settings | User::ShowDevBlogs;
        }
        if (@$_POST["showrpnews"] == "on") {
            $settings = $settings | User::ShowRPNews;
        }
        if (@$_POST["showtqstatus"] == "on") {
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:profile.php

示例10: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
if (isset($_GET["delete"]) && is_numeric(@$_GET["delete"]) && $cms->CurrentUser()->HasPortalRole(User::MDYN_Administrator)) {
    $cms->CoreSQL("DELETE FROM feedback WHERE id=" . $_GET["delete"] . " LIMIT 1");
    $cms->Goto("feedback.php");
} elseif ($cms->CurrentUser()->HasPortalRole(User::MDYN_Administrator)) {
    $feedbacks = array();
    $result = $cms->CoreSQL("SELECT * FROM feedback");
    while ($row = mysql_fetch_assoc($result)) {
        $feedbacks[] = array($cms->SQLUnEscape($row["Name"]), $cms->SQLUnEscape($row["EMail"]), $cms->SQLUnEscape($row["APIUserID"]), $cms->SQLUnEscape($row["APIKey"]), $cms->SQLUnEscape($row["Notes"]), $row["id"], $cms->GMTToLocal($row["Date"]));
    }
    $cms->assign("feedbacks", $feedbacks);
} elseif (@$_GET["result"] == "1") {
    $cms->assign("result", 1);
} elseif (@$_POST["submit"] == "Submit") {
    $query = "INSERT INTO feedback (Date,Name,Email,APIUserID,APIKey,Notes) VALUES (";
    $query .= "'" . $cms->GMTTime() . "',";
    $query .= "'" . $cms->SQLEscape($_POST["name"]) . "',";
    $query .= "'" . $cms->SQLEscape($_POST["email"]) . "',";
    $query .= "'" . $cms->SQLEscape($_POST["apiuserid"]) . "',";
    $query .= "'" . $cms->SQLEscape($_POST["apikey"]) . "',";
    $query .= "'" . $cms->SQLEscape($_POST["notes"]) . "')";
    $cms->CoreSQL($query);
    $cms->Goto("feedback.php?result=1");
}
$cms->display('feedback.tpl');
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:28,代码来源:feedback.php

示例11: elseif

    $action = "home";
}
$result = 0;
if (isset($_GET["read"]) && is_numeric(@$_GET["read"])) {
    $note = $cms->ReadArticle($_GET["read"]);
    $_POST["id"] = $note->ID;
    $_POST["title"] = $note->Title;
    $_POST["text"] = $note->Text;
    $_POST["readaccess"] = $note->ReadAccess;
    $_POST["writeaccess"] = $note->WriteAccess;
    $cms->assign("articleid", $note->ID);
    $cms->assign("authorid", $note->Author);
    $cms->assign("author", $note->AuthorName);
    $cms->assign("signature", $note->AuthorSignature);
    $cms->assign("date", $note->Date);
    $cms->assign("editid", $note->WriteAccess <= $cms->CurrentUser()->AccessRight() || $note->Author == $cms->CurrentUser()->ID ? $note->ID : 0);
    $cms->assign("isadmin", $note->Author != $cms->CurrentUser()->ID ? 1 : 0);
    $cms->assign("comments", $note->Comments);
    $action = "read";
} elseif (isset($_GET["edit"]) && is_numeric(@$_GET["edit"])) {
    $note = $cms->ReadArticle($_GET["edit"]);
    $_POST["id"] = $note->ID;
    $_POST["title"] = $note->Title;
    $_POST["text"] = $note->Text;
    $_POST["readaccess"] = $note->ReadAccess;
    $_POST["writeaccess"] = $note->WriteAccess;
    $action = "edit";
} elseif (isset($_GET["deletecomment"]) && is_numeric(@$_GET["deletecomment"])) {
    $article = $_GET["article"];
    $id = $_GET["deletecomment"];
    $cms->DeleteArticleComment($id);
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:articles.php


注:本文中的Core::CurrentUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。