本文整理汇总了PHP中Factory::getUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::getUser方法的具体用法?PHP Factory::getUser怎么用?PHP Factory::getUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Factory
的用法示例。
在下文中一共展示了Factory::getUser方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Delete
public function Delete()
{
Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
try {
$this->db->delete("ge_ads", $this->input->getInt("id"));
Messages::getInstance()->logSuccess('تبلیغ مورد نظر با موفقیت حذف شد');
} catch (Exception $ex) {
Messages::getInstance()->logError('هیچ تبلیغی حذف شد');
}
$this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/admin/ads/show");
}
示例2: saveSettings
function saveSettings()
{
Factory::getUser()->authorise("setting", ResponseRegistery::getInstance()->site_id);
$object = $this->input->get('POST');
$object['id'] = Session::getInstance()->weblog_id;
$user->account_no = $object['account_no'];
$user->cellphone = $object['cellphone'];
$user->id = Factory::getUser()->id;
unset($object['account_no']);
unset($object['cellphone']);
$this->db->StoreObject("wb_weblogs", $object);
$this->db->StoreObject("ge_users", $user);
$this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . '/dashboard/blog/settings');
}
示例3: showLinks
private function showLinks($linkType)
{
Factory::getUser()->authorise("link", ResponseRegistery::getInstance()->site_id);
$weblog_id = Session::getInstance()->weblog_id;
$dailyLinks = $this->db->SimpleSelect("wb_links", "id,url,title", "weblog_id={$weblog_id} AND type='{$linkType}'")->fetchAll();
$this->tmpl->loadPage("dailyLinks");
$this->tmpl->assign("dailyLinks", $dailyLinks);
$this->tmpl->assign("type", $linkType);
$linkInfo = $this->db->SimpleSelect("wb_links", "id,url,title", array("weblog_id" => $weblog_id, "id" => $this->input->getInt("id"), "type" => $linkType))->fetch();
if (!$linkInfo) {
$linkInfo = new istdClass();
}
$this->tmpl->assign("linkInfo", $linkInfo);
$this->reponse->setTemplate($this->tmpl);
}
示例4: saveStatus
public function saveStatus()
{
Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
fb($this->input->getInt('RequestID'));
if ($this->input->getInt('RequestID') != 0) {
$data->id = $this->input->getInt('RequestID');
$data->status = $this->input->getString('status');
try {
$this->db->StoreObject("sh_requests", $data);
Messages::getInstance()->logSuccess('تغییر مورد نظر با موفقیت انجام شد');
} catch (Exception $ex) {
Messages::getInstance()->logError('در انجام عملیات خطایی رخ داده است');
}
}
$this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopRequest/showrequest");
}
示例5: saveCode
public function saveCode()
{
Factory::getUser()->authorise("template", ResponseRegistery::getInstance()->site_id);
$db = Factory::getDBO();
$data->main = $this->input->getString('main');
$data->id = $this->getWebLogTemplateId();
$db->StoreObject("ge_templates", $data);
//Messages::getInstance()->logSuccess('قالب با موفقیت ذخیره و اعمال شد');
$msg = Messages::getInstance();
$msg->logSuccess('قالب با موفقیت ذخیره شد');
if ($this->compile($data->main, $data->id)) {
$msg->logSuccess('قالب با موفقیت اعمال شد');
} else {
$msg->logError('در ساختار قالب خطا وجود دارد لطفا قبل از نمایش وبلاگ این خطاها را بررسی کنید');
}
$this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/template/show");
}
示例6: findWeblogAddress
public function findWeblogAddress()
{
$db = Factory::getDBO();
$sql = 'SELECT
site.id,
sub_domain
FROM ge_subdomains sub
JOIN ge_sites as site
ON(sub.site_id=site.id)
JOIN ge_users_sites as us
ON(site.id=us.site_id)
WHERE
us.user_id=' . intval(Factory::getUser()->id);
fb(Factory::getUser()->id, 'user_id');
$sub = $db->query($sql)->fetch();
if ($sub) {
ResponseRegistery::getInstance()->site_id = $sub->id;
return $sub->sub_domain;
}
return false;
}
示例7: deleteSubgroup
public function deleteSubgroup()
{
Factory::getUser()->authorise("group", ResponseRegistery::getInstance()->site_id);
try {
$this->db->delete("sh_subgroups", $this->input->getInt('id'));
Messages::getInstance()->logSuccess("زیر گروه مورد نظر با موفقیت حذف شد");
} catch (Exception $e) {
Messages::getInstance()->logError("هیچ زیر گروهی حذف نشد");
}
$this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopGroup/showGroups");
}
示例8: logout
public function logout()
{
Factory::getUser()->logout();
$this->reponse->redirect(ResponseRegistery::getInstance()->baseURL);
}
示例9: delete
public function delete()
{
Factory::getUser()->authorise("item", ResponseRegistery::getInstance()->site_id);
try {
$item_id = $this->input->getInt('id');
$query = "DELETE FROM sh_subgroups_items WHERE item_id = {$item_id}";
$this->db->execute($query);
$query = "DELETE FROM sh_images WHERE item_id = {$item_id}";
$this->db->execute($query);
$query = "DELETE FROM sh_items WHERE id = {$item_id}";
$this->db->execute($query);
// [FIXIT] images file not delete
Messages::getInstance()->logSuccess("کالای مورد نظر با موفقیت حذف شد");
} catch (Exception $e) {
Messages::getInstance()->logError("هیچ کالایی حذف نشد");
Messages::getInstance()->logError($e);
}
$this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopItem/showItem");
}
示例10: disban
public function disban()
{
Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
$site_id = $this->input->getInt('id');
$tmp->id = $site_id;
$tmp->active = 1;
Factory::getDBO()->StoreObject("ge_sites", $tmp);
Messages::getInstance()->logSuccess('سایت مورد نظر با موفقیت فعال شد');
$this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/admin/blog/show");
}
示例11: commentDelete
public function commentDelete()
{
Factory::getUser()->authorise("comment", ResponseRegistery::getInstance()->site_id);
try {
$sql = 'DELETE FROM wb_comment WHERE id=' . $this->input->getInt('id');
//FIXME. ' and weblog_id=' . Session::getInstance()->weblog_id;
$this->db->execute($sql);
} catch (MySQLException $e) {
if ($e->getCode() == 1451) {
fb($e);
Messages::getInstance()->logWarning('یک یا چند پست با این موضع وجود دارد ابتدا انها را ویرایش کنید');
} else {
throw $e;
}
}
$this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/post/comment");
}
示例12: current
function current()
{
$id = $this->ids[$this->index]['id'];
return Factory::getUser($id);
}