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


PHP Staff::GetByUsername方法代码示例

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


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

示例1: CleanString

 $username = CleanString($_POST["username"]);
 $password = $_POST["password"];
 $password_confirm = $_POST["password_confirm"];
 $name = $_POST["name"];
 $building = $_POST["building"];
 $email = CleanString($_POST["email"]);
 $phone_number = CleanString($_POST["phone_number"]);
 $type = $_POST["type"];
 if (empty($username) || empty($password) || empty($name) || empty($building) || empty($email) || empty($phone_number)) {
     ShowError("One or more fields were empty!");
 } elseif ($password != $password_confirm) {
     ShowError("Passwords did not match! Go back and try again.");
 } elseif (!Building::Exists($building) && $building !== "N/A") {
     ShowError("Invalid building.");
 } else {
     $staff = Staff::GetByUsername($username);
     if ($staff->IsValid()) {
         if ($staff->IsActive()) {
             ShowError("A staff member with that username already exists");
         } else {
             $staff->SetPassword(EncryptPassword($password));
             $staff->Edit($name, $type, $building, $email, $phone_number);
             ShowInfo("Created Staff Member Successfully");
             RedirectTimer("admin&staff", 3);
         }
     } else {
         Staff::Add($name, $type, $username, EncryptPassword($password), $building, $email, $phone_number);
         ShowInfo("Created Staff Member Successfully");
         RedirectTimer("admin&staff", 3);
     }
 }
开发者ID:omusico,项目名称:Xion,代码行数:31,代码来源:admin.php

示例2: ShowError

    ?>
</h1>
	</div>
</div>

<?php 
    if (isset($_POST["update"])) {
        $update_description = $_POST["update_description"];
        if (empty($update_description)) {
            ShowError("You must enter an update description.", true);
        } else {
            $me->IncrementPoints(2);
            $ticket->AddUpdate($me->GetID(), $update_description);
        }
    } elseif (isset($_POST["reassign"])) {
        $staff = Staff::GetByUsername($_POST["staffusername"]);
        if ($staff->IsValid() && $staff->IsActive()) {
            if ($staff->GetID() == $ticket->GetStaffID()) {
                ShowError("You can not reassign a ticket to the same person!", true);
            } else {
                $body = $me->GetName() . " (" . $me->GetUsername() . ") has assigned you a ticket!";
                $staff->SendTextMessage($body . " Reply for more information.");
                $body .= $ticket->GetEmailBody($clientid, $name, $community, $building, $room);
                $staff->SendEmail("Ticket Assignment", $body);
                $ticket->SetStaffID($staff->GetID());
                ShowInfo("Reassigned Successfully");
            }
        } else {
            ShowError("Invalid staff member username", true);
        }
    } elseif (isset($_GET["status"])) {
开发者ID:omusico,项目名称:Xion,代码行数:31,代码来源:ticket.php


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