コード例 #1
0
ファイル: profile.php プロジェクト: babae/etano
Support at:                 http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license.                         *
******************************************************************************/
//define('CACHE_LIMITER','private');
require_once 'includes/common.inc.php';
require_once 'includes/user_functions.inc.php';
require_once 'includes/network_functions.inc.php';
check_login_member('profile_view');
$tpl = new phemplate(_BASEPATH_ . '/skins_site/' . get_my_skin() . '/', 'remove_nonjs');
$uid = 0;
if (!empty($_GET['uid'])) {
    $uid = (string) (int) $_GET['uid'];
} elseif (isset($_GET['user'])) {
    $user = sanitize_and_format($_GET['user'], TYPE_STRING, $__field2format[FIELD_TEXTFIELD]);
    $uid = get_userid_by_user($user);
} elseif (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id'])) {
    $uid = (string) $_SESSION[_LICENSE_KEY_]['user']['user_id'];
} else {
    redirect2page('index.php');
}
if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $_SESSION[_LICENSE_KEY_]['user']['user_id'] == $uid) {
    redirect2page('my_profile.php');
}
$output = array();
// we don't care about user status because the cache generator will generate the profile for the user only if status is approved
// also _photo is set only with approved photos.
$query = "SELECT `fk_user_id` as `uid`,`_user` as `user`,`_photo` as `photo` FROM `{$dbtable_prefix}user_profiles` WHERE `fk_user_id`={$uid} AND `del`=0";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
コード例 #2
0
ファイル: join.php プロジェクト: babae/etano
 $input = array();
 // get the input we need and sanitize it
 $input['page'] = sanitize_and_format_gpc($_POST, 'page', TYPE_INT, 0, 1);
 if ($input['page'] == 1) {
     $input['user'] = strtolower(sanitize_and_format_gpc($_POST, 'user', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], ''));
     $input['pass'] = sanitize_and_format_gpc($_POST, 'pass', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], '');
     $input['email'] = strtolower(sanitize_and_format_gpc($_POST, 'email', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], ''));
     $input['email2'] = strtolower(sanitize_and_format_gpc($_POST, 'email2', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], ''));
     $input['agree'] = sanitize_and_format_gpc($_POST, 'agree', TYPE_INT, 0, 0);
     if (!preg_match('/^[a-z0-9_]+$/', $input['user']) || strlen($input['user']) < 4 || strlen($input['user']) > 20) {
         $error = true;
         $topass['message']['type'] = MESSAGE_ERROR;
         $topass['message']['text'][] = $GLOBALS['_lang'][63];
         $input['error_user'] = '******';
     }
     if (!$error && ($input['user'] == 'guest' || get_userid_by_user($input['user']))) {
         $error = true;
         $topass['message']['type'] = MESSAGE_ERROR;
         $topass['message']['text'][] = $GLOBALS['_lang'][64];
         $input['error_user'] = '******';
     }
     if (!$error && empty($input['pass'])) {
         $error = true;
         $topass['message']['type'] = MESSAGE_ERROR;
         $topass['message']['text'][] = $GLOBALS['_lang'][65];
         $input['error_pass'] = '******';
     }
     if (!$error && $input['email'] != $input['email2']) {
         $error = true;
         $topass['message']['type'] = MESSAGE_ERROR;
         $topass['message']['text'][] = $GLOBALS['_lang'][37];
コード例 #3
0
ファイル: filters_addedit.php プロジェクト: babae/etano
}
$error = false;
$qs = '';
$qs_sep = '';
$topass = array();
$nextpage = 'filters.php';
$input = array();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // get the input we need and sanitize it
    foreach ($message_filters_default['types'] as $k => $v) {
        $input[$k] = sanitize_and_format_gpc($_POST, $k, $__field2type[$v], $__field2format[$v], $message_filters_default['defaults'][$k]);
    }
    $input['fk_user_id'] = $_SESSION[_LICENSE_KEY_]['user']['user_id'];
    switch ($input['filter_type']) {
        case FILTER_SENDER:
            if (!($input['field_value'] = get_userid_by_user($input['field_value']))) {
                $error = true;
                $topass['message']['type'] = MESSAGE_ERROR;
                $topass['message']['text'] = sprintf($GLOBALS['_lang'][41], $input['field_value']);
            }
            break;
        case FILTER_SENDER_PROFILE:
        case FILTER_MESSAGE:
        default:
            break;
    }
} else {
    // not working
    $input['filter_id'] = $message_filters_default['defaults']['filter_id'];
    $input['filter_type'] = _FILTER_USER_;
    $input['fk_user_id'] = $_SESSION[_LICENSE_KEY_]['user']['user_id'];
コード例 #4
0
ファイル: user_exists.php プロジェクト: babae/etano
<?php

/******************************************************************************
Etano
===============================================================================
File:                       ajax/user_exists.php
$Revision$
Software by:                DateMill (http://www.datemill.com)
Copyright by:               DateMill (http://www.datemill.com)
Support at:                 http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license.                         *
******************************************************************************/
require_once dirname(__FILE__) . '/../includes/common.inc.php';
require_once dirname(__FILE__) . '/../includes/user_functions.inc.php';
$output = '';
if (!empty($_POST['user'])) {
    $user = sanitize_and_format($_POST['user'], TYPE_STRING, $__field2format[FIELD_TEXTFIELD]);
    if (get_userid_by_user($user) || $user == 'guest') {
        $output = 1;
    }
}
echo $output;