/**
 * Friends Picker
 *
 * @return false|null|mixed data
 * @access public
 */
function ossn_friend_picker()
{
    header('Content-Type: application/json');
    if (!ossn_isLoggedin()) {
        exit;
    }
    $user = new OssnUser();
    $friends = $user->getFriends(ossn_loggedin_user()->guid);
    if (!$friends) {
        return false;
    }
    foreach ($friends as $users) {
        $p['first_name'] = $users->first_name;
        $p['last_name'] = $users->last_name;
        $p['imageurl'] = ossn_site_url("avatar/{$users->username}/smaller");
        $p['id'] = $users->guid;
        $usera[] = $p;
    }
    echo json_encode($usera);
}
$user['bdy'] = input('birthy');
if (!empty($user)) {
    foreach ($user as $field => $value) {
        if (empty($value)) {
            ossn_trigger_message(ossn_print('fields:require'), 'error');
            redirect(REF);
        }
    }
}
$types = array('normal', 'admin');
if (!in_array($user['type'], $types)) {
    ossn_trigger_message(ossn_print('account:create:error:admin'), 'error');
    redirect(REF);
}
$user['birthdate'] = "{$user['bdd']}/{$user['bdm']}/{$user['bdy']}";
$add = new OssnUser();
$add->username = $user['username'];
$add->first_name = $user['firstname'];
$add->last_name = $user['lastname'];
$add->email = $user['email'];
$add->password = $user['password'];
$add->gender = $user['gender'];
$add->birthdate = $user['birthdate'];
$add->usertype = $user['type'];
if (!$add->isUsername($user['username'])) {
    ossn_trigger_message(ossn_print('username:error'), 'error');
    redirect(REF);
}
if (!$add->isPassword()) {
    ossn_trigger_message(ossn_print('password:error'), 'error');
    redirect(REF);
Beispiel #3
0
if (!empty($user)) {
    foreach ($user as $field => $value) {
        if (empty($value)) {
            ossn_trigger_message(ossn_print('fields:require'), 'error');
            redirect(REF);
        }
    }
}
$password = input('password');
$types = array('normal', 'admin');
if (!in_array($user['type'], $types)) {
    ossn_trigger_message(ossn_print('account:create:error:admin'), 'error');
    redirect(REF);
}
$user['birthdate'] = "{$user['bdd']}/{$user['bdm']}/{$user['bdy']}";
$OssnUser = new OssnUser();
$OssnUser->password = $password;
$OssnUser->email = $user['email'];
$OssnDatabase = new OssnDatabase();
$params['table'] = 'ossn_users';
$params['wheres'] = array("guid='{$entity->guid}'");
$params['names'] = array('first_name', 'last_name', 'email', 'type');
$params['values'] = array($user['firstname'], $user['lastname'], $user['email'], $user['type']);
//check if email is not in user
if ($entity->email !== input('email')) {
    if ($OssnUser->isOssnEmail()) {
        ossn_trigger_message(ossn_print('email:inuse'), 'error');
        redirect(REF);
    }
}
//check if email is valid email
Beispiel #4
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
ossn_load_external_js('chart.js', 'admin');
ossn_load_external_js('chart.legend.js', 'admin');
$users = new OssnUser();
$total = array($users->countByGender(), $users->countByGender('female'));
$online = array($users->onlineByGender('male', true), $users->onlineByGender('female', true));
$unvalidated = $users->getUnvalidatedUSERS('', true);
$flush_cache = ossn_site_url("action/admin/cache/flush", true);
?>
<div class="ossn-admin-dsahboard">
	<div class="row">
    
    	<div class="col-md-12 admin-dashboard-item">
        	<div class="admin-dashboard-box">
        		<div class="admin-dashboard-title"><?php 
echo ossn_print("users");
?>
</div>
            	<div class="admin-dashboard-contents">
            			<canvas id="users-count-graph"></canvas>
                        <div id="usercount-lineLegend"></div>
Beispiel #5
0
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
if (ossn_isAdminLoggedin()) {
    redirect('administrator/dashboard');
}
$username = input('username');
$password = input('password');
//check if username is email
if (strpos($username, '@') !== false) {
    $user = ossn_user_by_email($username);
    $username = $user->username;
}
if (ossn_user_by_username($username)->type !== 'admin') {
    ossn_trigger_message(ossn_print('login:error'), 'error');
    redirect(REF);
}
if (empty($username) || empty($password)) {
    ossn_trigger_message(ossn_print('login:error'), 'error');
    redirect(REF);
}
$login = new OssnUser();
$login->username = $username;
$login->password = $password;
if ($login->Login()) {
    ossn_trigger_message(ossn_print('login:success'), 'success');
    redirect(REF);
} else {
    ossn_trigger_message(ossn_print('login:error'), 'error');
    redirect(REF);
}
/**
 * Register a uservalidation page
 * @pages:
 *       uservalidate,
 *
 * @return bool
 */
function ossn_uservalidate_pagehandler($pages)
{
    $page = $pages[0];
    if (empty($page)) {
        echo ossn_error_page();
    }
    switch ($page) {
        case 'activate':
            if (!empty($pages[1]) && !empty($pages[2])) {
                $user = new OssnUser();
                $user->guid = $pages[1];
                if ($user->ValidateRegistration($pages[2])) {
                    ossn_trigger_message(ossn_print('user:account:validated'), 'success');
                    redirect();
                } else {
                    ossn_trigger_message(ossn_print('user:account:validate:fail'), 'success');
                    redirect();
                }
            }
            break;
    }
}
Beispiel #7
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
OssnUser::Logout();
redirect('administrator?logout=true');
Beispiel #8
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$user = new OssnUser();
//get users
$by_year = $user->countByYearMonth();
if (!$by_year) {
    return;
}
//sort out data
foreach ($by_year as $item) {
    $years[] = $item->year;
    if ((int) $item->month !== 10) {
        $item->month = str_replace(0, '', $item->month);
    }
    $data[$item->year][$item->month] = $item->total;
}
//get unqiue years
$years = array_unique($years);
$years = array_reverse($years);
for ($i = 1; $i <= 12; $i++) {
    foreach ($years as $year) {
        if (!isset($data[$year][$i])) {
Beispiel #9
0
 /**
  * Search site users with its entities
  *
  * @return boolean
  */
 public function searchUsers($q, $limit = '')
 {
     $search = $this->SearchSiteUsers($q, $limit);
     if (!$search) {
         return false;
     }
     $users = new OssnUser();
     foreach ($search as $user) {
         $users->guid = $user->guid;
         $userentity[] = $users->getUser();
     }
     $data = $userentity;
     return $data;
 }
$user['gender'] = input('gender');
$user['bdd'] = input('birthday');
$user['bdm'] = input('birthm');
$user['bdy'] = input('birthy');
foreach ($user as $field => $value) {
    if (empty($value)) {
        ossn_installation_message(ossn_print('fields:require'), 'fail');
        redirect(REF);
    }
}
if ($user['reemail'] !== $user['email']) {
    ossn_installation_message(ossn_print('emai:match:error'), 'fail');
    redirect(REF);
}
$user['birthdate'] = "{$user['bdd']}/{$user['bdm']}/{$user['bdy']}";
$add = new OssnUser();
$add->username = $user['username'];
$add->first_name = $user['firstname'];
$add->last_name = $user['lastname'];
$add->email = $user['email'];
$add->password = $user['password'];
$add->gender = $user['gender'];
$add->birthdate = $user['birthdate'];
$add->sendactiviation = false;
$add->usertype = 'admin';
if (!$add->isUsername($user['username'])) {
    ossn_installation_message(ossn_print('username:error'), 'fail');
    redirect(REF);
}
if (!$add->isPassword()) {
    ossn_installation_message(ossn_print('password:error'), 'fail');
<?php

/**
 *    OpenSource-SocialNetwork
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
$users = new OssnUser();
$pagination = new OssnPagination();
$pagination->setItem($users->getUnvalidatedUSERS());
$list = $pagination->getItem();
?>
<div class="top-controls top-controls-users-page">
    <a href="<?php 
echo ossn_site_url("administrator/adduser");
?>
" class="ossn-admin-button button-green"><?php 
echo ossn_print('add');
?>
</a>
</div>
<table class="table ossn-users-list">
    <tbody>
    <tr class="table-titles">
        <td><?php 
echo ossn_print('name');
?>
Beispiel #12
0
/**
 * Add profile search page handler
 *
 * @return string data;
 */
function profile_search_handler($hook, $type, $return, $params)
{
    $Pagination = new OssnPagination();
    $users = new OssnUser();
    $data = $users->searchUsers($params['q']);
    $Pagination->setItem($data);
    $user['users'] = $Pagination->getItem();
    $search = ossn_plugin_view('output/users', $user);
    $search .= $Pagination->pagination();
    if (empty($data)) {
        return ossn_print('ossn:search:no:result');
    }
    return $search;
}
<?php

/**
 *    OpenSource-SocialNetwork
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
$search = input('search_users');
$users = new OssnUser();
$pagination = new OssnPagination();
if (!empty($search)) {
    $pagination->setItem($users->SearchSiteUsers($search));
} else {
    $pagination->setItem($users->getSiteUsers());
}
?>
<div class="top-controls top-controls-users-page">
    <a href="<?php 
echo ossn_site_url("administrator/adduser");
?>
"
       class="ossn-admin-button button-green"><?php 
echo ossn_print('add');
?>
</a>
</div>
<table class="table ossn-users-list">
function profile_search_handler($hook, $type, $return, $params)
{
    $Pagination = new OssnPagination();
    $users = new OssnUser();
    $data = $users->searchUsers($params['q']);
    $Pagination->setItem($data);
    $user['users'] = $Pagination->getItem();
    $search = ossn_view('system/templates/users', $user);
    $search .= $Pagination->pagination();
    if (empty($data)) {
        return 'No result found';
    }
    return $search;
}
Beispiel #15
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$users = new OssnUser();
$pagination = new OssnPagination();
$search = input('search_users');
$data = $users->getUnvalidatedUSERS($search);
$pagination->setItem($data);
$list = $pagination->getItem();
?>
<div class="row">
    <form method="post">
        <input type="text" name="search_users" placeholder="<?php 
echo ossn_print('search');
?>
" />
        <input type="submit" class="btn btn-primary" value="<?php 
echo ossn_print('search');
?>
"/>
    </form>    
</div>
<div class="row margin-top-10">