本文整理汇总了PHP中AdminHandler::updatePassword方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHandler::updatePassword方法的具体用法?PHP AdminHandler::updatePassword怎么用?PHP AdminHandler::updatePassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminHandler
的用法示例。
在下文中一共展示了AdminHandler::updatePassword方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Response
if (!authenticate('1', null)) {
return new Response('Unauthorized', 401);
}
$object = array('admin_id' => $admin_id, 'role_id' => $request->get('role_id'));
$handler = new AdminHandler();
$result = $handler->updateRole($object);
return new Response($result['message'], $result['status_code']);
});
// Update password
$app->POST('/admin/{admin_id}/password', function (Application $app, Request $request, $admin_id) {
if (!authenticate('user', $admin_id)) {
return new Response('Unauthorized', 401);
}
$object = array('admin_id' => $admin_id, 'password' => $request->get('password'));
$handler = new AdminHandler();
$result = $handler->updatePassword($object);
return new Response($result['message'], $result['status_code']);
});
// Delete admin
$app->DELETE('/admin/{admin_id}', function (Application $app, Request $request, $admin_id) {
if (!authenticate('1', null)) {
return new Response('Unauthorized', 401);
}
$handler = new AdminHandler();
$result = $handler->delete($admin_id);
return new Response($result['message'], $result['status_code']);
});
// optional geolocation in body
$app->GET('/businesses/{category}/{subcategory}', function (Application $app, Request $request, $subcategory) {
return new Response('How about implementing businessRepairSubcategoryGet as a GET method ?');
});