function CreateLTIGroup($user, $name, $context_id, $consumer_key) { $group_guid = 0; $group = new ElggGroup($group_guid); // Set the group properties that we can! $group->name = $name; $group->context_id = $context_id; // This is a unique identifier from the consumer for this context $group->consumer_key = $consumer_key; // Which consumer is creating this group $group->membership = ACCESS_PRIVATE; $group->access_id = ACCESS_PUBLIC; $group->briefdescription = elgg_echo('LTI:provision:group'); $consumer_instance = new LTI_Tool_Consumer_Instance($group->consumer_key, elgg_get_config('dbprefix')); $context = new LTI_Context($consumer_instance, $group->context_id); $group->description = $context->title; $group->save(); $group->join($user); // Add images $prefix = 'groups/' . $group->guid; $filename = GetImage($consumer_key, '.jpg'); $thumbtiny = get_resized_image_from_existing_file($filename, 25, 25, true); $thumbsmall = get_resized_image_from_existing_file($filename, 40, 40, true); $thumbmedium = get_resized_image_from_existing_file($filename, 100, 100, true); $thumblarge = get_resized_image_from_existing_file($filename, 200, 200, false); if ($thumbtiny) { $thumb = new ElggFile(); $thumb->owner_guid = $group->owner_guid; $thumb->setMimeType('image/jpeg'); $thumb->setFilename($prefix . "tiny.jpg"); $thumb->open("write"); $thumb->write($thumbtiny); $thumb->close(); $thumb->setFilename($prefix . "small.jpg"); $thumb->open("write"); $thumb->write($thumbsmall); $thumb->close(); $thumb->setFilename($prefix . "medium.jpg"); $thumb->open("write"); $thumb->write($thumbmedium); $thumb->close(); $thumb->setFilename($prefix . "large.jpg"); $thumb->open("write"); $thumb->write($thumblarge); $thumb->close(); $group->icontime = time(); } // return the URL return $group; }
function Login($msg = '') { $challenge = rand(); session_register(S_ID . "_challenge"); $_SESSION[S_ID . "_challenge"]["random"] = $challenge; echo "<html>\n" . "<head>\n" . "<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\" />\n" . "<title>" . TITLE . " :: Кто здесь??</title>\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"/templates/design.css\" />\n" . "<script src=\"js/md5.js\" type=\"text/javascript\"></script>\n" . "<script type=\"text/javascript\">\n" . "function Change()\n" . "{\n" . " document.login.challenge.value = hex_md5(document.login.challenge.value + hex_md5(document.login.pswd.value));\n" . " document.login.pswd.value = '';\n" . " return true;\n" . "}\n" . "function SetFocus()\n" . "{\n"; if (isset($_GET["name"])) { echo "\tdocument.login.name.select();\n"; } echo "\tdocument.login.name.focus();\n" . "}\n" . "</script>\n" . "</head>\n" . "<body onLoad=\"SetFocus()\">\n" . "<table style='background-color: #ffffff;' cellspacing=0 cellpadding=0 border=0 width=100% height=100%>\n" . " <tr height=30% valign=\"center\">\n" . "\t<td width=23% align=\"center\">" . GetImage("./templates/pngs/", 97, 150) . "</td>\n" . "\t<td width=54% rowspan=3 align=\"center\">\n"; if ($msg != '') { MessageBox($msg); } echo "\t <form name=\"login\" action=\"\" method=\"GET\" onSubmit=\"Change()\">\n" . "\t <input type=\"hidden\" name=\"challenge\" value=\"" . $challenge . "\">" . "\t <table class=\"clogin\" cellspacing=0 cellpadding=0 border=0 width=500 height=200>\n" . "\t \t<tr valign=\"center\">" . " \t\t <td colspan=4 width=100% align=\"left\"><h4> Кто здесь?!</h4></td>\n" . " \t\t</tr>\n" . "\t \t<tr class=\"clogin\" valign=\"center\">\n" . "\t \t <td> </td>\n" . " \t\t <td width=40% class=\"cloginint\" align=\"right\">Логин: </td>\n" . "\t\t <td width=50% align=\"left\"><input class=\"clogininttable\" type=\"text\" name=\"name\" size=15 maxlength=20"; if (isset($_GET["name"])) { echo " value=\"" . $_GET["name"] . "\""; } echo "></td>\n" . "\t\t <td width=10%> </td>\n" . "\t \t</tr>\n" . "\t\t<tr class=\"clogin\"><td colspan=2> </td></tr>\n" . "\t \t<tr class=\"clogin\" valign=\"center\">\n" . "\t \t <td> </td>\n" . "\t \t <td class=\"cloginint\" align=\"right\">Пароль: </td>\n" . " \t \t <td align=\"left\"><input class=\"clogininttable\" type=\"password\" name=\"pswd\" size=15 maxlength=20></td>\n" . "\t\t <td> </td>\n" . "\t \t</tr>\n" . "\t \t<tr valign=\"center\">\n" . "\t \t <td colspan=4 align=\"center\"><input class=\"clogininttable\" style=\"font-size: 20px; width: 240;\" type=\"submit\" value=\"Войти!\"></td>\n" . "\t \t</tr>\n" . "\t </table>\n" . "\t </form>\n" . "\t<td width=23% align=\"center\" align='center'> </td>\n" . " </tr>\n" . " <tr height=50% valign=\"bottom\">\n" . "\t<td width=23% rowspan=2 align=\"center\"> </td>\n" . "\t\t<td align='center'>" . "<a href='http://vedro.skynet/'>" . GetImage("./templates/logos/", 1) . "</a>" . "\t\t</td>" . " </tr>\n" . "<tr height=10% valign='center'>" . "\t<td align=\"center\" valign='bottom'><div style='font-size: 18px;'><a href='http://vedro.skynet/'>vedro.skynet</a></div><br /></td>\n" . " </tr>" . "</table>\n" . "</body>\n" . "</html>"; }
function Render() { // Don't render anything but warnings if there are any warnings or if there is a postback if ($this->PostBackAction == "") { if ($this->Context->WarningCollector->Count() > 0) { $this->Context->Writer->Write($this->Get_Warnings()); } else { $this->Context->Writer->Add("<div class=\"Account\">"); if ($this->Context->Session->User->Setting("HtmlOn", 1) && $this->User->DisplayIcon != "") { $this->Context->Writer->Add("<h1 class=\"AccountWithIcon\"><span class=\"AccountIcon\" style=\"background-image:url('" . $this->User->DisplayIcon . "')\"></span>"); } else { $this->Context->Writer->Add("<h1>"); } $this->Context->Writer->Add($this->User->FullName . "</h1>\r\n\t\t\t\t\t<small>" . $this->User->Role . "</small>\r\n\t\t\t\t\t<div class=\"AccountBody\">"); if ($this->User->RoleDescription != "") { $this->Context->Writer->Add("<blockquote>" . $this->User->RoleDescription . "</blockquote>"); } if ($this->User->Picture != "" && $this->User->CanPostHTML && $this->Context->Session->User->Setting("HtmlOn", 1)) { $this->Context->Writer->Add("<div class=\"Picture\">" . GetImage($this->User->Picture, "", "", "Picture", "") . "</div>"); } $this->Context->Writer->Add("<div class=\"AccountData\">\n<dl>\r\n\t\t\t\t\t\t\t<dt>" . $this->Context->GetDefinition("Account") . "</dt>\r\n\t\t\t\t\t\t\t<dd>" . ($this->User->ShowName || $this->Context->Session->User->AdminUsers ? $this->User->Name : "n/a") . "</dd>\r\n\t\t\t\t\t\t\t<dt>" . $this->Context->GetDefinition("Email") . "</dt>\r\n\t\t\t\t\t\t\t<dd>" . ($this->Context->Session->UserID > 0 && ($this->User->UtilizeEmail || $this->Context->Session->User->AdminUsers) ? GetEmail($this->User->Email) : "n/a") . "</dd>\r\n\t\t\t\t\t\t\t<dt>" . $this->Context->GetDefinition("AccountCreated") . "</dt>"); $this->Context->Writer->Add("<dd>" . TimeDiff($this->User->DateFirstVisit, mktime()) . "</dd>\n"); $this->Context->Writer->Add("<dt>" . $this->Context->GetDefinition("MemberOfGroups") . "</dt>\n<dd>" . implode("</br>", $this->User->UserGroups) . "</dd>"); $this->Context->Writer->Add("<dt>" . $this->Context->GetDefinition("LastActive") . "</dt>\r\n\t\t\t\t\t\t\t<dd>" . TimeDiff($this->User->DateLastActive, mktime()) . "</dd>\r\n\t\t\t\t\t\t\t<dt>" . $this->Context->GetDefinition("VisitCount") . "</dt>\r\n\t\t\t\t\t\t\t<dd>" . $this->User->CountVisit . "</dd>\r\n\t\t\t\t\t\t\t<dt>" . $this->Context->GetDefinition("DiscussionsStarted") . "</dt>\r\n\t\t\t\t\t\t\t<dd>" . $this->User->CountDiscussions . "</dd>\r\n\t\t\t\t\t\t\t<dt>" . $this->Context->GetDefinition("CommentsAdded") . "</dt>\r\n\t\t\t\t\t\t\t<dd>" . $this->User->CountComments . "</dd>" . $this->Context->ObjectFactory->RenderControlStrings("Account", "RenderUserProperties")); if ($this->Context->Session->User->AdminUsers) { $this->Context->Writer->Add("\r\n\t\t\t\t\t\t\t\t<dt>" . $this->Context->GetDefinition("LastKnownIp") . "</dt>\r\n\t\t\t\t\t\t\t\t<dd>" . $this->User->RemoteIp . "</dd>\r\n\t\t\t\t\t\t\t\t"); } if (count($this->User->Attributes) > 0) { for ($i = 0; $i < count($this->User->Attributes); $i++) { $this->Context->Writer->Add("\r\n\t\t\t\t\t\t\t\t\t\t<dt>" . $this->User->Attributes[$i]["Label"] . "</dt>\r\n\t\t\t\t\t\t\t\t\t\t<dd>" . FormatHyperlink($this->User->Attributes[$i]["Value"]) . "</dd>\r\n\t\t\t\t\t\t\t\t\t"); } } $this->Context->Writer->Add("</dl>\r\n\t\t\t\t\t</div></div>\r\n\t\t\t\t</div>"); $this->Context->Writer->Write(); } } }
function getJieShao_xizang($lineid, $webid, $templets) { global $dsql; $str = ""; $sql = "select isstyle,lineday,txtjieshao,jieshao from #@__line where aid='{$lineid}' and webid='{$webid}'"; $row = $dsql->GetOne($sql); if (empty($row['isstyle']) || $row['isstyle'] == 0) { $row['isstyle'] = 1; } else { $row['isstyle'] = $row['isstyle']; } if ($row['isstyle'] == 1) { $str = $row['jieshao']; } elseif ($row['isstyle'] == 2) { $arr = explode(",", $row['txtjieshao']); for ($i = 1; $i <= $row['lineday']; $i++) { $detail = explode("||", $arr[$i - 1]); $str .= "<dl class=\"travelnum travel\">"; $str .= " <dt>第<b>{$i}</b>天:{$detail[0]}</dt>"; $str .= " <dd><span>饮食:" . GetAttr("food", $detail[1]) . "</span><span>住宿:" . $detail[3] . "</span><span>交通:" . GetAttr("trans", $detail[2]) . "</span></dd>"; $str .= "</dl>"; $str .= "<div>"; $str .= $detail[4]; $str .= "</div>"; $str .= "<ul class=\"img_xc clearfix\">"; $str .= GetImage($detail[7], $detail[6], $detail[5]); $str .= "</ul>"; } } return $str; }
<? require_once($_SERVER["DOCUMENT_ROOT"]."/constants.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/miscellaneous/images.php"); $width = -1; if (isset($_REQUEST["width"])) $width = $_REQUEST["width"]; GetImage(base64_decode($_REQUEST["file"]), $width); ?>
<?php session_start(); LBD_HttpHelper::FixEscapedQuerystrings(); LBD_HttpHelper::CheckForIgnoredRequests(); // There are several Captcha commands accessible through the Http interface; // first we detect which of the valid commands is the current Http request for. if (!array_key_exists('get', $_GET) || !LBD_StringHelper::HasValue($_GET['get'])) { LBD_HttpHelper::BadRequest('command'); } $commandString = LBD_StringHelper::Normalize($_GET['get']); $command = LBD_CaptchaHttpCommand::FromQuerystring($commandString); switch ($command) { case LBD_CaptchaHttpCommand::GetImage: GetImage(); break; case LBD_CaptchaHttpCommand::GetSound: GetSound(); break; case LBD_CaptchaHttpCommand::GetValidationResult: GetValidationResult(); break; default: LBD_HttpHelper::BadRequest('command'); break; } // Returns the Captcha image binary data function GetImage() { // saved data for the specified Captcha object in the application $captcha = GetCaptchaObject();
// ObjectSid is binary - need to use ldap_get_values_len() to ensure that it's correctly retrieved - only needed if retrieving full attributes if ($_GET["full_details"] == "y") { $entry = ldap_first_entry($ldap, $sr); $objectsid = ldap_get_values_len($ldap, $entry, "objectsid"); $info[0]["objectsid"][0] = $objectsid[0]; } // Sort by keys ksort($info[0]); ?> <!-- LDAP details header --> <td> <div class='ldap_details'> <div> <img src='<?php echo GetImage($info[0][$image_link_ldap_attribute][0]); ?> ' alt='<?php echo $info[0][$image_link_ldap_attribute][0]; ?> '/> <?php echo $_GET["full_details"] == "y" ? __("Full") : __("Partial"); echo __(' LDAP details for ') . $info[0][$image_link_ldap_attribute][0] . " [" . $ldap_info["name"] . "]"; ?> <hr /> </div> <!-- LDAP details table --> <table> <tr><th><?php
* Elgg LTI * * Display the LTI object ------------------------------------------------------------------*/ $consumer_instance_guid = $vars['consumer_guid']; $consumer_instance = new LTI_Tool_Consumer_Instance($consumer_instance_guid, elgg_get_config('dbprefix')); $consumer_tool = new LTI_Tool_Consumer($consumer_instance->consumer_guid, elgg_get_config('dbprefix')); $url = elgg_get_site_entity()->url; if ($consumer_instance->isEnabled()) { $enabled = 'yes'; $info = '<div class="plugin_details active">'; } else { $enabled = 'no'; $info = '<div class="plugin_details not-active">'; } $icon = '<img src="' . GetImage($consumer_instance->guid, '.png') . '" title="Image of Consumer" />'; $info .= '<table>'; $info .= '<tr><th class = "column1"></th><th class = "column2"></th><th class = "column3">Name</th><th class = "column4">Consumer Name</th><th class = "column5"></th></tr>'; $info .= '<tr>'; $info .= '<td class = "column1">' . $icon . '</td>'; $info .= '<td class = "column2">'; $info .= '<a href="editconsumer?LTIconsumerguid=' . $consumer_instance->guid . '" alt="Edit consumer" title="Edit Consumer"><img src="' . elgg_get_config('wwwroot') . 'mod/blti/images/edit.gif' . '"></a>'; $info .= '<a href="' . $url . 'blti/delete/' . $consumer_instance->guid . '" alt="Delete consumer" title="Delete Consumer"><img src="' . elgg_get_config('wwwroot') . 'mod/blti/images/delete.gif' . '"></a>'; $info .= '</td>'; $info .= '<td class = "column3">' . $consumer_tool->name . '</td>'; $info .= '<td class = "column4">' . $consumer_tool->consumer_name . '</td>'; $url = elgg_add_action_tokens_to_url(elgg_get_config('wwwroot') . 'action/' . elgg_get_config('ltiname') . '/enable?guid=' . $consumer_instance->guid); $option = $consumer_instance->isEnabled() ? 'Disable' : 'Enable'; $info .= '<td class = "column5"><div class="admin_plugin_enable_disable"><a href="' . $url . '">' . $option . '</a></div></td>'; $info .= '</tr>'; $info .= '</table>';
function GetBigAvatar($uid) { $member = M("member")->alias("m")->where(array("m.id" => $uid))->join("left join __MEMBER_BIND__ mb on mb.uid = m.id and mb.type='weixin'")->field("m.avatar3,mb.info as weixin")->find(); if ($member) { if ($member['avatar1']) { return GetImage($member['avatar1']); } if ($member['weixin']) { $array = json_decode($member['weixin'], true); if (!empty($array) && is_array($array) && isset($array['headimgurl']) && 0 != strlen($array['headimgurl'])) { return $array['headimgurl']; } } $_uid = sprintf("%09d", $uid); $dir1 = substr($_uid, 0, 3); $dir2 = substr($_uid, 3, 2); $dir3 = substr($_uid, 5, 2); $dir4 = substr($_uid, 7, 2); $home = $dir1 . '/' . $dir2 . '/' . $dir3 . '/' . $dir4; $path = 'Ucenter/data/avatar/' . $home . '_avatar_big.jpg'; if (file_exists($path)) { $avatar = MoveImage($path); M("member")->where("id={$uid}")->save(array("avatar1" => $avatar)); return GetImage($avatar); } } return 'http://www.alhelp.net/ucenter/images/noavatar_big.gif'; }
public function talk_mslist_get() { $page = intval(I('get.page')); $page = empty($page) ? 1 : $page; $mp = M("member_post"); $lwhere = array("mp.pid" => 0, "mp.status" => array("neq", "-1")); $lwhere['_string'] = " m.is_vip_order>0 "; //提交了community_id(member_post字段community_id,实际为school的id)则只查询指定圈子的说说 $school_id = $this->get_request_data('community_id'); if ($school_id) { $lwhere['s.id'] = $school_id; } $options = array("alias" => "mp", "where" => $lwhere, "join" => array("inner join member m on m.id = mp.member_id and m.status = 1", "left join community c on c.id = mp.community_id", "left join school s on s.id = c.table_id and c.table_type = 'school'"), "field" => "mp.*, if(s.group_member_id != 0 and s.group_member_id = mp.member_id, '1', '0') as is_com_owner", "order" => "mp.time_announcement desc ,mp.time_top desc,mp.time_hot desc,mp.add_time desc"); $_GET["p"] = $page; $mp->options = $options; $total = $mp->count(); $pageCount = ceil($total / $this->pageSize); if ($pageCount < $_GET['p']) { $_GET['p'] = $pageCount; } $pageObj = new \Think\Page($total, $this->pageSize); $options['limit'] = $pageObj->firstRow . ',' . $pageObj->listRows; $data = $mp->select($options); // print_r($mp->_sql()); foreach ($data as &$talk) { // 附件相关 $att = M('attachments'); $att = $att->where(array('table' => "member_post", 'table_id' => $talk['id'], 'status' => 1))->field('sha1')->select(); foreach ($att as &$a) { $a = GetImage($a['sha1']); } $talk['attachments'] = $att; $talk["community"] = D("Community")->getcommunityInfo($talk["community_id"]); $talk["avatar"] = GetSmallAvatar($talk['member_id']); $c_where = array('mp.pid' => $talk["id"], 'mp.status' => 1); $talk['is_hot'] = $talk['time_hot'] > 0 ? 1 : 0; $talk['is_top'] = $talk['time_top'] > 0 ? 1 : 0; $talk['is_announcement'] = $talk['time_announcement'] > 0 ? 1 : 0; //如果在登陆状态,需要查询该用户是否赞过该说说 if ($this->uid) { $is_praised = M('praise')->where(array('table_name' => 'member_post', 'member_id' => $this->uid, 'catid' => $talk['id'], 'status' => '1'))->count() ? '1' : '0'; $talk['is_praised'] = $is_praised; } // if ($this->uid && $this->uid != $talk['member_id']) { // $_c_where = array(); // $_c_where['mp.hide'] = 0; // $_c_where["mp.member_id"] = $this->uid; // $_c_where["_logic"] = "or"; // $c_where["_complex"] = $_c_where; // } else { // $c_where['mp.hide'] = 0; // } // 回复相关 // $comment = $mp // ->alias('mp') // ->join("left join member m on m.id=mp.member_id") // ->join("left join member_post_message mpm on mpm.new_id=mp.id and // mpm.type=2") // ->field("mp.*") // ->where($c_where) // ->order('mp.add_time desc') // ->select(); // dump($mp->_sql()); // foreach ($comment as &$c) { // $c['avatar'] = GetSmallAvatar($c['member_id']); // if ($c['type'] >= 2 && $c['to_member_id'] != $talk['member_id']) // { // $c['to'] = $c['to_member_id']; // } else { // $c['to'] = null; // } // unset($c['type']); // unset($c['to_member_id']); // } // $talk["comment"] = $comment; } $data = array('list' => $data, 'count' => $total, 'next_page' => null); if ($pageCount > 1 && $page < $pageCount) { $data['next_page'] = $this->url('/v1/talks/list/master/page/' . ++$page); } $this->success($data); }