本文整理汇总了PHP中msg::set_text方法的典型用法代码示例。如果您正苦于以下问题:PHP msg::set_text方法的具体用法?PHP msg::set_text怎么用?PHP msg::set_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msg
的用法示例。
在下文中一共展示了msg::set_text方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lang
function try_login()
{
$this->user = $this->facebook->getUser();
//defaultni vypis problemu s prihlasenim
$l = new lang("layout");
$msg = new msg();
if ($this->user == null) {
$msg->set_text($l->t("bad_fb_login"), "error");
redirect($l->l("prihlaseni"));
}
//nyni mame udaje o uzivateli
//pokusime se zjistit, zda-li jiz v databazi nekdo takovy je (fb_id)
$sql = sql_query("select id, nick from users\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere (fb_id = '" . $this->user . "')");
$data = sql_fetch_object($sql);
//jiz v databzi existuje
if ($data->id) {
$_SESSION['uid'] = $data->id;
$_SESSION['me'] = new me($data->id);
$_SESSION['me']->homepage_redirect();
} else {
$new_login = $this->create_login();
if ($new_login) {
$_SESSION['uid'] = $new_login[0];
$_SESSION['me'] = new me($new_login[0]);
//prvotni presun po registraci na nastaveni a doplneni udaju
header("location: " . $l->l("osobni-udaje") . "?first=true");
return true;
}
}
$msg->set_text($l->t("bad_fb_login"), "error");
redirect($l->l("prihlaseni"));
}
示例2: lang
function try_login()
{
//defaultni vypis problemu s prihlasenim
$l = new lang("layout");
$msg = new msg();
//pokud nam google vrati code, muzeme se autentifikovat a ziksat token
$code = clear("code");
if ($code) {
$this->client->authenticate();
$this->token = $this->client->getAccessToken();
}
/*
//kdybychom chteli na nejake jine strance zase s uctem u googlu pracovat
// musimve vytvorit to spojeni a pomoci se token ze session se autorizovat u googlu
//ale mi tady session token nulujeme, takze uz se dal pouzit neda
if ($_SESSION['token']) {
$this->client->setAccessToken($_SESSION['token']);
}
//kdyz ho chceme ziskat
$_SESSION['token'] = $this->client->getAccessToken();
*/
if ($this->token) {
$my_data = $this->plus->people->get('me');
$gp_id = $my_data['id'];
//nyni mame udaje o uzivateli
//pokusime se zjistit, zda-li jiz v databazi nekdo takovy je (gp_id)
$sql = sql_query("select id, nick from users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (gp_id = '" . $gp_id . "')");
$data = sql_fetch_object($sql);
//jiz v databazi existuje
if ($data->id) {
$_SESSION['uid'] = $data->id;
$_SESSION['me'] = new me($data->id);
$_SESSION['me']->homepage_redirect();
} else {
$new_login = $this->create_login($my_data);
if ($new_login) {
$_SESSION['uid'] = $new_login[0];
$_SESSION['me'] = new me($new_login[0]);
//prvotni presun po registraci na nastaveni a doplneni udaju
header("location: " . $l->l("osobni-udaje") . "?first=true");
return true;
}
}
}
$msg->set_text($l->t("bad_gplus_login"), "error");
redirect($l->l("prihlaseni"));
}