本文整理汇总了PHP中BaseController::isSigned方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseController::isSigned方法的具体用法?PHP BaseController::isSigned怎么用?PHP BaseController::isSigned使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseController
的用法示例。
在下文中一共展示了BaseController::isSigned方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createUser
public static function createUser($user_fp, $input, $timestamp = false)
{
$timestamp = $timestamp ? $timestamp : date('Y-m-d H:i:s');
$pub_hash = BaseController::randString(8) . strtolower(substr($user_fp, -8));
$priv_hash = BaseController::randString(32);
$clear_info = BaseController::isSigned(trim($input['info']));
$user = new User();
$user->public_hash = $pub_hash;
$user->private_hash = password_hash($priv_hash, PASSWORD_BCRYPT);
$user->pgp = trim($input['key']);
$user->user_fp = $user_fp;
$user->info = $input['info'] ? $input['info'] : "";
$user->clear_info = $clear_info ? $clear_info : "";
$user->active_session = "";
$user->timestamp = $timestamp;
$user->save();
return ['priv_hash' => $priv_hash, 'user' => $user];
}
示例2: createPost
public static function createPost($user_fp, $input, $timestamp = false)
{
$timestamp = $timestamp ? $timestamp : date('Y-m-d H:i:s');
if ($input['parent_id'] != 0) {
$parent_post = Post::findOrFail($input['parent_id']);
if ($parent_post->parent_id != 0) {
App::abort(500, "Illegal post_id");
}
if (Ban::isBanned($parent_post->user_fp, $user_fp)) {
App::abort(500, "You are banned");
}
if ($parent_post->group_name != "" && Group::where('group_name', $parent_post->group_name)->first()->is_private == 1) {
if (!Gsub::membership($user_fp, $parent_post->group_name)) {
App::abort(500, 'Only members of group can leave comments.');
}
}
} else {
if ($input['group_name']) {
$group = Group::where('group_name', $input['group_name'])->firstOrFail();
if ($group->is_private == 1) {
if (!Gsub::membership($user_fp, $input['group_name'])) {
App::abort(500, 'Membership required to post.');
}
}
}
}
$message = rtrim($input['message']);
$plaintext = BaseController::isSigned($message);
$post = new Post();
$post->parent_id = $input['parent_id'] ? $input['parent_id'] : 0;
$post->user_fp = $user_fp;
$post->timestamp = $timestamp;
if ($input['source_link']) {
$post->source_link = $input['source_link'];
}
if ($input['title']) {
$post->title = $input['title'];
}
if ($plaintext) {
$post->clear_message = self::convertEmoji($plaintext);
$post->message = $message;
} else {
$post->clear_message = "";
$post->message = self::convertEmoji($message);
}
if (!isset($parent_post)) {
if ($input['chan']) {
$post->chan = $input['chan'];
}
if ($input['group_name']) {
$post->group_name = $input['group_name'];
}
}
$post->save();
if (isset($parent_post)) {
$parent_post->replies += 1;
$parent_post->save();
}
return $post;
}
示例3: rtrim
→ <a href="#" class="text-warning small">/g/{{{Input::get('group_name')}}}</a>
@endif
@ 1 second ago .txt
<a href="#"class="btn btn-xs btn-default">{{Lang::get('board.post_more')}}</a>
@if(Input::get('source_link'))
<a href="#"class="btn btn-xs btn-default">{{Lang::get('general.link')}}</a>
@endif
</div>
<div class="panel-body">
@if(Input::get('title'))
<h1>{{{Input::get('title')}}}</h1>
@endif
<?php
$message = rtrim(Input::get('message'));
if (BaseController::userFp() != "") {
$plaintext = BaseController::isSigned($message);
if ($plaintext) {
$message = Post::convertEmoji($plaintext);
} else {
$message = Post::convertEmoji($message);
}
$html_post = OnelonMarkup::markup($message, true);
} else {
$html_post = OnelonMarkup::markup($message);
}
?>
<div>{{ $html_post }}</div>
</div>
</div>
@include('post_form')