Exemple #1
0
 static function getBasicProfile($user_name)
 {
     $fse_info = Cache::get('FSEBasicProfile', $user_name);
     if ($fse_info == false) {
         $db = Loader::db();
         $fse_info = $db->getRow("SELECT * FROM fse_basic_profiles WHERE user_name=?", array($user_name));
         if (count($fse_info) == 0) {
             return false;
         }
         $fse_info['avatar_url'] = get_url_from_file_id($fse_info['avatar_file_id']);
         Cache::set('FSEBasicProfile', $user_name, $fse_info, self::FSEINFO_CACHE_EXPIRED_TIME);
     }
     return $fse_info;
 }
Exemple #2
0
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
defined('C5_EXECUTE') or die('Access Denied.');
require_once 'helpers/misc.php';
$db = Loader::db();
$fse_info = $db->getRow("SELECT user_name, nick_name, avatar_file_id,\n\t\tlocation_country, location_province, location_district, self_desc,\n\t\tpublic_email, public_url, public_org, DATE(create_time) as joined_date\n\tFROM fse_basic_profiles WHERE user_name=?", array($fseUsername));
if (count($fse_info) == 0) {
    echo "<p>No such user</p>";
} else {
    $avatar_url = get_url_from_file_id($fse_info['avatar_file_id'], '/files/images/icon-def-avatar.png');
    $location_country = substr(strstr($fse_info['location_country'], ':'), 1);
    $location_province = substr(strstr($fse_info['location_province'], ':'), 1);
    $location_district = substr(strstr($fse_info['location_district'], ':'), 1);
    ?>

<section class="public-profile">
	<header>
		<img class="large-avatar" alt="Avatar" src="<?php 
    echo $avatar_url;
    ?>
" />
		<h2><?php 
    echo h5($fse_info['nick_name']);
    ?>
</h2>
Exemple #3
0
 public static function addOwnerMemberSection($project_id, $fse_info = false)
 {
     /* add owner member section on misc page */
     if ($fse_info == false) {
         $project_info = ProjectInfo::getBasicInfo($project_id);
         if ($project_info == false) {
             exit(0);
         }
         $fse_info = FSEInfo::getNameInfo($project_info['fse_id']);
         $fse_info = FSEInfo::getBasicProfile($fse_info['user_name']);
     } else {
         $fse_info['avatar_url'] = get_url_from_file_id($fse_info['avatar_file_id']);
     }
     $page_path = self::assemblePath($project_id, 'misc');
     $about_page = Page::getByPath($page_path);
     $type_handle = 'member:markdown_safe:' . $fse_info['user_name'] . ':primary:none';
     $section_content = sprintf(self::OWNER_MARKDOWN_TEXT, FSEInfo::getPersonalHomeLink($fse_info, true), FSEInfo::getPersonalHomeLink($fse_info), $fse_info['avatar_url'], ProjectInfo::$mRoleDescriptions[substr($project_id, -2)]['owner'], h5($fse_info['self_desc']));
     $section_manager = new DocSectionManager();
     $res = $section_manager->addNewSection($fse_info['fse_id'], $about_page->getCollectionID(), 'Members', $project_id, 'misc', 'na', 'na', 'na', $type_handle, '', $section_content, '[]');
 }
Exemple #4
0
		href="<?php 
echo ProjectInfo::assemblePath($project_id, 'download');
?>
" class="tab-item"><span
		class="glyphicon glyphicon-download"></span></a>
	<a <?php 
echo $domain_handle == 'home' ? 'class="active"' : '';
?>
		href="<?php 
echo ProjectInfo::assemblePath($project_id, 'home');
?>
" class="tab-item"><span
		class="glyphicon glyphicon-home"></span></a>

<?php 
if ($domain_handle != 'home') {
    ?>
		<img src="<?php 
    echo get_url_from_file_id($project_info['icon_file_id'], '/files/images/icon-fsen-144.png');
    ?>
"/ alt="Logo Icon" />
		<h1><?php 
    echo h5($project_info['name']);
    ?>
</h1>
<?php 
}
?>
</nav>

 * limitations under the License.
 */
defined('C5_EXECUTE') or die('Access Denied.');
require_once 'helpers/check_login.php';
require_once 'helpers/misc.php';
$js = Loader::helper('json');
class ReturnInfo
{
    public $status;
    public $fse_info;
}
$ret_info = new ReturnInfo();
$ret_info->status = 'bad';
$ret_info->fse_info = NULL;
if (!fse_try_to_login()) {
    echo $js->encode($ret_info);
    exit(0);
}
$ret_info->status = 'ok';
$ret_info->fse_info = $_SESSION['FSEInfo'];
$ret_info->fse_info['fse_id'] = NULL;
$ret_info->fse_info['hashed_passwd'] = NULL;
if (!isset($ret_info->fse_info['avatar_url'])) {
    $ret_info->fse_info['avatar_url'] = get_url_from_file_id($_SESSION['FSEInfo']['avatar_file_id'], '/files/images/icon-def-avatar.png');
    $ret_info->fse_info['small_avatar_url'] = get_thumbnail_url_from_file_id($_SESSION['FSEInfo']['avatar_file_id'], '/files/images/icon-def-avatar-small.png');
}
echo $js->encode($ret_info);
exit(0);
?>

Exemple #6
0
 public function get_public_profile($user_name = false)
 {
     $ret_info = new ReturnInfo();
     $ret_info->status = 'bad';
     $ret_info->fse_info = array();
     $js = Loader::helper('json');
     if (!fse_try_to_login()) {
         echo $js->encode($ret_info);
         exit(0);
     }
     if ($user_name) {
         $ret_info->status = 'ok';
         $ret_info->fse_info = FSEInfo::getPublicProfile($user_name);
     } else {
         $ret_info->status = 'ok';
         $fse_info = $_SESSION['FSEInfo'];
         unset($fse_info['fse_id']);
         unset($fse_info['hashed_passwd']);
         # we return email box for the logged in user
         # unset ($fse_info['email_box']);
         # unset ($fse_info['avatar_file_id']);
         if (!isset($fse_info['avatar_url'])) {
             $fse_info['avatar_url'] = get_url_from_file_id($fse_info['avatar_file_id']);
         }
         $ret_info->fse_info = $fse_info;
     }
     echo $js->encode($ret_info);
     exit(0);
 }
Exemple #7
0
<?php 
$db = Loader::db();
$projects = $db->getAll("SELECT project_id, name, short_desc, icon_file_id,\n\t\tpage_theme, repo_location, repo_name, code_lang, doc_lang, platform, license\n\tFROM fsen_projects WHERE fse_id=?", array($_SESSION['FSEInfo']['fse_id']));
if (count($projects) > 0) {
    ?>
		<section class="block-list-with-icon">
			<ul>
<?php 
    foreach ($projects as $project) {
        $title_license = t('License');
        $title_code_lang = t('Language');
        $title_platform = t('Platform');
        $title_page_theme = t('Page Theme');
        $title_repo_location = t('Repo. Location');
        $title_repo_name = t('Repo. Name');
        $icon_url = get_url_from_file_id($project['icon_file_id'], '/files/images/icon-fsen-144.png');
        ?>
<li>
	<a class="item-icon" onclick="chooseIcon ('<?php 
        echo $project['project_id'];
        ?>
');" href="#"><img
		id="icon-<?php 
        echo $project['project_id'];
        ?>
"
		data-org="<?php 
        echo $project['icon_file_id'];
        ?>
"
		title="Click to change the icon"
Exemple #8
0
if ($_SESSION[$form_token_name] != $form_token) {
    $ret_info->detail = t('Bad request or session expired.');
    echo $json->encode($ret_info);
    exit(0);
}
//unset ($_SESSION [$form_token_name]);
$comment = DocSectionManager::newComment($domain_handle, $section_id, $_SESSION['FSEInfo']['fse_id'], $comment_action, $comment_body, $comment_reply_to);
if ($comment == false) {
    $ret_info->status = 'error';
    $ret_info->detail = t('Bad comment');
    echo $json->encode($ret_info);
    exit(0);
}
$author_info = $_SESSION['FSEInfo'];
if (!isset($fse_info['avatar_url'])) {
    $author_info['avatar_url'] = get_url_from_file_id($author_info['avatar_file_id']);
}
$uh = Loader::helper('concrete/urls');
$bt = BlockType::getByHandle('document_section');
$delete_action = $uh->getBlockTypeToolsURL($bt) . '/delete_comment.php';
if (preg_match("/^[0-9a-f]{32}\$/", $comment['replied_author_id'])) {
    $replied_name_info = FSEInfo::getNameInfo($comment['replied_author_id']);
    if ($replied_name_info == false) {
        unset($replied_name_info);
    }
}
$ret_info->status = 'success';
$ret_info->detail = '
<li id="liComment' . $comment['id'] . '" class="list-group-item">
	<div class="media">
		<span class="badge">' . $author_info['heat_level'] . '</span>