當前位置: 首頁>>代碼示例>>PHP>>正文


PHP People::UpdatePerson方法代碼示例

本文整理匯總了PHP中People::UpdatePerson方法的典型用法代碼示例。如果您正苦於以下問題:PHP People::UpdatePerson方法的具體用法?PHP People::UpdatePerson怎麽用?PHP People::UpdatePerson使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在People的用法示例。


在下文中一共展示了People::UpdatePerson方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

    }
    $response = array();
    $p = new People();
    $p->PersonID = $personid;
    if (!$p->GetPerson()) {
        $response['error'] = true;
        $response['errorcode'] = 404;
        $response['message'] = __("User not found in database.");
        echoResponse(200, $response);
    } else {
        // Slim Framework will simply return null for any variables that were not passed, so this is safe to call without blowing up the script
        foreach ($p as $prop) {
            $p->{$prop} = $app->request->post($prop);
        }
        $p->Disabled = false;
        if (!$p->UpdatePerson()) {
            $response['error'] = true;
            $response['errorcode'] = 403;
            $response['message'] = __("Unable to update People resource with the given parameters.");
            echoResponse(200, $response);
        } else {
            $response['error'] = false;
            $response['errorcode'] = 200;
            $response['message'] = sprintf(__('People resource for UserID=%1$s updated successfully.'), $p->UserID);
            $response['people'] = $p;
            echoResponse(200, $response);
        }
    }
});
//
//	URL:	/api/v1/people
開發者ID:mnibbelink,項目名稱:openDCIM,代碼行數:31,代碼來源:index.php

示例2: isset

        $userRights->ReadAccess = isset($_POST['ReadAccess']) ? 1 : 0;
        $userRights->WriteAccess = isset($_POST['WriteAccess']) ? 1 : 0;
        $userRights->DeleteAccess = isset($_POST['DeleteAccess']) ? 1 : 0;
        $userRights->ContactAdmin = isset($_POST['ContactAdmin']) ? 1 : 0;
        $userRights->RackRequest = isset($_POST['RackRequest']) ? 1 : 0;
        $userRights->RackAdmin = isset($_POST['RackAdmin']) ? 1 : 0;
        $userRights->SiteAdmin = isset($_POST['SiteAdmin']) ? 1 : 0;
        $userRights->Disabled = isset($_POST['Disabled']) ? 1 : 0;
        if ($_POST['action'] == 'Create') {
            $userRights->CreatePerson();
            // We've, hopefully, successfully created a new device. Force them to the new device page.
            header('Location: ' . redirect("usermgr.php?PersonID={$userRights->PersonID}"));
            exit;
        } else {
            $status = __("Updated");
            $userRights->UpdatePerson();
        }
    } else {
        //Should we ever add a delete user function it will go here
    }
    // Reload rights because actions like disable reset other rights
    $userRights->GetUserRights();
}
$userList = $userRights->GetUserList();
$adminown = $userRights->AdminOwnDevices ? "checked" : "";
$read = $userRights->ReadAccess ? "checked" : "";
$write = $userRights->WriteAccess ? "checked" : "";
$delete = $userRights->DeleteAccess ? "checked" : "";
$contact = $userRights->ContactAdmin ? "checked" : "";
$request = $userRights->RackRequest ? "checked" : "";
$RackAdmin = $userRights->RackAdmin ? "checked" : "";
開發者ID:ghasedak,項目名稱:openDCIM,代碼行數:31,代碼來源:usermgr.php


注:本文中的People::UpdatePerson方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。