예제 #1
0
파일: index.php 프로젝트: koki-h/xoops_utf8
function partnersAdmin()
{
    $xoopsDB =& Database::getInstance();
    $myts =& MyTextSanitizer::getInstance();
    xoops_cp_header();
    echo "<h4>" . _MD_PARTNERADMIN . "</h4>\n    <form action='index.php' method='post' name='reorderform'>\n    <table width='100%' border='0' cellspacing='1' cellpadding='0' class='outer'><tr>\n    <th width='10%' align='center'>" . _MD_TITLE . "</th>\n    <th width='3%' align='center'>" . _MD_IMAGE . "</th>\n    <th>" . _MD_DESCRIPTION . "</th>\n    <th width='3%' align='center'>" . _MD_ACTIVE . "</th>\n    <th width='3%' align='center'>" . _MD_WEIGHT . "</th>\n    <th width='3%' align='center'>" . _MD_HITS . "</th>\n    <th>&nbsp;</th></tr>";
    $result = $xoopsDB->query("SELECT id, hits, url, weight, image, title, description, status FROM " . $xoopsDB->prefix("partners") . " ORDER BY status DESC, weight ASC, title DESC");
    $class = 'even';
    while (list($id, $hits, $url, $weight, $image, $title, $description, $status) = $xoopsDB->fetchrow($result)) {
        $url = formatURL($myts->makeTboxData4Show($url));
        $image = formatURL($myts->makeTboxData4Show($image));
        $title = $myts->makeTboxData4Show($title);
        $description = $myts->makeTboxData4Show($description);
        $imageInfo = @getimagesize($image);
        $imageWidth = $imageInfo[0];
        $imageHeight = $imageInfo[1];
        $check1 = "";
        $check2 = "";
        if ($status == 1) {
            $check1 = "selected='selected'";
        } else {
            $check2 = "selected='selected'";
        }
        if ($imageWidth >= 110 or $imageHeight >= 50) {
            $errorMsg = "<br />" . _MD_IMAGE_ERROR;
        } else {
            $errorMsg = "";
        }
        echo "<tr>\n        <td class='{$class}' width='10%' align='center' valign='middle'><a href='" . $url . "' target='_blank'>" . $title . "</a></td>\n        <td class='{$class}' width='3%' align='center'>";
        if (!empty($image)) {
            echo "<img src='" . $image . "' alt='" . $title . "' width='102' height='47' />" . $errorMsg;
        }
        echo "</td><td class='{$class}'>" . $description . "</td>\n        <td class='{$class}' width='3%' align='center'>\n        <select size='1' name='status[{$id}]'> <option value='1' " . $check1 . ">" . _MD_YES . "</option><option value='0' " . $check2 . ">" . _MD_NO . "</option></select>\n        <td class='{$class}' width='3%' align='center'>";
        echo "<input type='text' name='weight[{$id}]' value='{$weight}' size='3' maxlength='3' style='text-align: center;' />";
        echo "</td><td class='{$class}' width='3%' align='center'>" . $hits . "</td>\n        <td class='{$class}' width='3%' align='center'>\n        <a href='index.php?op=editPartner&amp;id=" . $id . "'>" . _MD_EDIT . "</a><br />--<br /><a href='index.php?op=delPartner&amp;id=" . $id . "'>" . _MD_DELETE . "</a>\n        </td></tr>";
        $class = $class == 'odd' ? 'even' : 'odd';
    }
    echo "<tr><td class='foot' colspan='7' align='right'>\n    <input type='hidden' name='op' value='reorderPartners' />\n    <input type='button' name='button' onclick=\"location='index.php?op=partnersAdminAdd'\" value='" . _MD_PARTNERS_ADD . "' />\n    <input type='button' name='button' onclick=\"location='index.php?op=reorderAutoPartners'\" value='" . _MD_AUTOMATIC_SORT . "' />\n    <input type='submit' name='submit' value='" . _MD_REORDER . "' />\n    </td></tr></table></form>";
    xoops_cp_footer();
}
예제 #2
0
/**
 * Updates the member profile, saving the changes to the database
 *
 * @param $uid
 * @param $uname
 * @param $login_name
 * @param $name
 * @param $url
 * @param $email
 * @param $user_icq
 * @param $user_aim
 * @param $user_yim
 * @param $user_msnm
 * @param $user_from
 * @param $user_occ
 * @param $user_intrest
 * @param $user_viewemail
 * @param $user_avatar
 * @param $user_sig
 * @param $attachsig
 * @param $theme
 * @param $pass
 * @param $pass2
 * @param $rank
 * @param $bio
 * @param $uorder
 * @param $umode
 * @param $notify_method
 * @param $notify_mode
 * @param $timezone_offset
 * @param $user_mailok
 * @param $language
 * @param $openid
 * @param $user_viewoid
 * @param $pass_expired
 * @param $groups
 */
function updateUser($uid, $uname, $login_name, $name, $url, $email, $user_icq, $user_aim, $user_yim,
					$user_msnm, $user_from, $user_occ, $user_intrest, $user_viewemail, $user_avatar,
					$user_sig, $attachsig, $theme, $pass, $pass2, $rank, $bio, $uorder, $umode, $notify_method,
					$notify_mode, $timezone_offset, $user_mailok, $language, $openid, $user_viewoid,
					$pass_expired, $groups = array()
					) {
	global $icmsConfig, $icmsModule, $icmsConfigUser;
	$member_handler = icms::handler('icms_member');
	$edituser =& $member_handler->getUser($uid);
	if ($edituser->getVar('uname') != $uname && $member_handler->getUserCount(new icms_db_criteria_Item('uname', $uname)) > 0 || $edituser->getVar('login_name') != $login_name && $member_handler->getUserCount(new icms_db_criteria_Item('login_name', $login_name)) > 0) {
		icms_cp_header();
		echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/users/images/users_big.png)">' . _MD_AM_USER . '</div><br />';
		echo _AM_UNAME . ' ' . $uname . ' ' . _AM_ALREADY_EXISTS;
		icms_cp_footer();
	} else {
		$edituser->setVar('name', $name);
		$edituser->setVar('uname', $uname);
		$edituser->setVar('login_name', $login_name);
		$edituser->setVar('email', $email);
		$edituser->setVar('openid', $openid);
		$user_viewoid = (isset($user_viewoid) && $user_viewoid == 1) ? 1 : 0;
		$edituser->setVar('user_viewoid', $user_viewoid);
		$url = isset($url) ? formatURL($url) : '';
		$edituser->setVar('url', $url);
		$edituser->setVar('user_icq', $user_icq);
		$edituser->setVar('user_from', $user_from);
		if ($icmsConfigUser['allow_htsig'] == 0) {
			$signature = strip_tags(icms_core_DataFilter::codeDecode($user_sig, 1));
			$edituser->setVar('user_sig', icms_core_DataFilter::icms_substr($signature, 0, (int) $icmsConfigUser['sig_max_length']));
		} else {
			$signature = icms_core_DataFilter::checkVar($user_sig, 'html', 'input');
			$edituser->setVar('user_sig', $signature);
		}
		$user_viewemail = (isset($user_viewemail) && $user_viewemail == 1) ? 1 : 0;
		$edituser->setVar('user_viewemail', $user_viewemail);
		$edituser->setVar('user_aim', $user_aim);
		$edituser->setVar('user_yim', $user_yim);
		$edituser->setVar('user_msnm', $user_msnm);
		$attachsig = (isset($attachsig) && $attachsig == 1) ? 1 : 0;
		$edituser->setVar('attachsig', $attachsig);
		$edituser->setVar('timezone_offset', $timezone_offset);
		$edituser->setVar('uorder', $uorder);
		$edituser->setVar('umode', $umode);
		$edituser->setVar('notify_method', $notify_method);
		$edituser->setVar('notify_mode', $notify_mode);
		$edituser->setVar('bio', $bio);
		$edituser->setVar('rank', $rank);
		$edituser->setVar('user_occ', $user_occ);
		$edituser->setVar('user_intrest', $user_intrest);
		$edituser->setVar('user_mailok', $user_mailok);
		$edituser->setVar('language', $language);
		if ($pass2 != '') {
			if ($pass != $pass2) {
				icms_cp_header();
				echo "<strong>" . _AM_STNPDNM . "</strong>";
				icms_cp_footer();
				exit();
			}

			$icmspass = new icms_core_Password();
			$edituser->setVar('pass_expired', $pass_expired);
			$pass = $icmspass->encryptPass($pass);
			$edituser->setVar('pass', $pass);
		}
		if (!$member_handler->insertUser($edituser)) {
			icms_cp_header();
			echo $edituser->getHtmlErrors();
			icms_cp_footer();
		} else {
			if ($groups != array()) {
				$oldgroups = $edituser->getGroups();
				//If the edited user is the current user and the current user WAS in the webmaster's group and is NOT in the new groups array
				if ($edituser->getVar('uid') == icms::$user->getVar('uid') && (in_array(XOOPS_GROUP_ADMIN, $oldgroups)) && !(in_array(XOOPS_GROUP_ADMIN, $groups))) {
					//Add the webmaster's group to the groups array to prevent accidentally removing oneself from the webmaster's group
					$groups[] = XOOPS_GROUP_ADMIN;
				}
				$member_handler = icms::handler('icms_member');
				foreach ($oldgroups as $groupid) {
					$member_handler->removeUsersFromGroup($groupid, array($edituser->getVar('uid')));
				}
				foreach (
					$groups as $groupid) {$member_handler->addUserToGroup($groupid, $edituser->getVar('uid'));
				}
			}
			redirect_header('admin.php?fct=users', 1, _AM_DBUPDATED);
		}
	}
	exit();
}
예제 #3
0
             break;
         case XOOPS_MATCH_END:
             $criteria->add(new Criteria('email', '%' . $myts->addSlashes(trim($_REQUEST['user_email'])), 'LIKE'));
             break;
         case XOOPS_MATCH_EQUAL:
             $criteria->add(new Criteria('email', $myts->addSlashes(trim($_REQUEST['user_email']))));
             break;
         case XOOPS_MATCH_CONTAIN:
             $criteria->add(new Criteria('email', '%' . $myts->addSlashes(trim($_REQUEST['user_email'])) . '%', 'LIKE'));
             break;
     }
     $requete_pagenav .= '&amp;email=' . htmlspecialchars($_REQUEST["user_email"]) . '&amp;user_email_match=' . htmlspecialchars($_REQUEST['user_email_match']);
     $requete_search .= 'email : ' . $_REQUEST['user_email'] . ' et user_email_match=' . $_REQUEST['user_email_match'] . '<br />';
 }
 if (!empty($_REQUEST['user_url'])) {
     $url = formatURL(trim($_REQUEST['user_url']));
     $criteria->add(new Criteria('url', $url . '%', 'LIKE'));
     $requete_search .= 'url : ' . $_REQUEST['user_url'] . '<br />';
 }
 if (!empty($_REQUEST['user_icq'])) {
     $match = !empty($_REQUEST['user_icq_match']) ? intval($_REQUEST['user_icq_match']) : XOOPS_MATCH_START;
     switch ($match) {
         case XOOPS_MATCH_START:
             $criteria->add(new Criteria('user_icq', $myts->addSlashes(trim($_REQUEST['user_icq'])) . '%', 'LIKE'));
             break;
         case XOOPS_MATCH_END:
             $criteria->add(new Criteria('user_icq', '%' . $myts->addSlashes(trim($_REQUEST['user_icq'])), 'LIKE'));
             break;
         case XOOPS_MATCH_EQUAL:
             $criteria->add(new Criteria('user_icq', '%' . $myts->addSlashes(trim($_REQUEST['user_icq']))));
             break;
예제 #4
0
파일: main.php 프로젝트: amjadtbssm/website
 $member_handler =& xoops_gethandler('member');
 // make sure the username doesnt exist yet
 if ($member_handler->getUserCount(new Criteria('uname', $uname)) > 0) {
     $adduser_errormsg = 'User name ' . $uname . ' already exists';
 } else {
     $newuser =& $member_handler->createUser();
     if (isset($user_viewemail)) {
         $newuser->setVar("user_viewemail", $user_viewemail);
     }
     if (isset($attachsig)) {
         $newuser->setVar("attachsig", $attachsig);
     }
     $newuser->setVar("name", $name);
     $newuser->setVar("uname", $uname);
     $newuser->setVar("email", $email);
     $newuser->setVar("url", formatURL($url));
     $newuser->setVar("user_avatar", 'blank.gif');
     $newuser->setVar("user_icq", $user_icq);
     $newuser->setVar("user_from", $user_from);
     $newuser->setVar("user_sig", $user_sig);
     $newuser->setVar("user_aim", $user_aim);
     $newuser->setVar("user_yim", $user_yim);
     $newuser->setVar("user_msnm", $user_msnm);
     if ($pass2 != "") {
         if ($pass != $pass2) {
             xoops_cp_header();
             echo "\r\n\t\t\t\t\t<b>" . _AM_STNPDNM . "</b>";
             xoops_cp_footer();
             exit;
         }
         $newuser->setVar("pass", md5($pass));
예제 #5
0
 if (!$GLOBALS['xoopsSecurity']->check()) {
     $stop .= implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) . "<br />";
 }
 xoops_load("captcha");
 $xoopsCaptcha = XoopsCaptcha::getInstance();
 if (!$xoopsCaptcha->verify()) {
     $stop .= $xoopsCaptcha->getMessage() . "<br />";
 }
 if (empty($stop)) {
     $member_handler =& xoops_gethandler('member');
     $newuser =& $member_handler->createUser();
     $newuser->setVar('user_viewemail', $user_viewemail, true);
     $newuser->setVar('uname', $uname, true);
     $newuser->setVar('email', $email, true);
     if ($url != '') {
         $newuser->setVar('url', formatURL($url), true);
     }
     $newuser->setVar('user_avatar', 'blank.gif', true);
     $actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);
     $newuser->setVar('actkey', $actkey, true);
     $newuser->setVar('pass', md5($pass), true);
     $newuser->setVar('timezone_offset', $timezone_offset, true);
     $newuser->setVar('user_regdate', time(), true);
     $newuser->setVar('uorder', $xoopsConfig['com_order'], true);
     $newuser->setVar('umode', $xoopsConfig['com_mode'], true);
     $newuser->setVar('user_mailok', $user_mailok, true);
     if ($xoopsConfigUser['activation_type'] == 1) {
         $newuser->setVar('level', 1, true);
     } else {
         $newuser->setVar('level', 0, true);
     }
		<?php 
    }
    ?>
		<?php 
    if ($wpInfo->link) {
        ?>
        <tr bgcolor="#F2ECDB">
          <td width=200><?php 
        echo _SITE_LINK;
        ?>
</td>
          <td valign="top"><a href='<?php 
        echo formatURL($wpInfo->link);
        ?>
' target="_blank"><?php 
        echo formatURL($wpInfo->link);
        ?>
</a>&nbsp;</td>
        </tr>
		<?php 
    }
    ?>
		<?php 
    if ($wpInfo->description) {
        ?>
        <tr bgcolor="#F2ECDB">
          <td width=200><?php 
        echo _SITE_DESCR;
        ?>
</td>
          <td valign="top"><?php 
예제 #7
0
$Ltemplate->assign_vars(array('MAX_SPEED' => formatSpeed($flight->MAX_SPEED), 'MAX_VARIO' => formatVario($flight->MAX_VARIO), 'MEAN_SPEED' => formatSpeed($flight->MEAN_SPEED), 'MIN_VARIO' => formatVario($flight->MIN_VARIO)));
if ($flight->is3D()) {
    $Ltemplate->assign_vars(array('MAX_ALT' => formatAltitude($flight->MAX_ALT), 'TAKEOFF_ALT' => formatAltitude($flight->TAKEOFF_ALT), 'MIN_ALT' => formatAltitude($flight->MIN_ALT), 'ALTITUDE_GAIN' => formatAltitude($flight->MAX_ALT - $flight->TAKEOFF_ALT)));
} else {
    $Ltemplate->assign_vars(array('MAX_ALT' => 0, 'TAKEOFF_ALT' => 0, 'MIN_ALT' => 0, 'ALTITUDE_GAIN' => 0));
}
/* 	$flight->filename
		echo "<div id='geOptionsPos' style='float:right'>";
		echo "<a href='javascript:nop()' onclick=\"toggleVisible('geOptionsID','geOptionsPos',14,-80,170,'auto');return false;\">Google Earth&nbsp;<img src='".$moduleRelPath."/img/icon_arrow_down.gif' border=0></a></div>";
*/
if ($flight->comments) {
    $comments = $flight->comments;
}
$linkURL = _N_A;
if ($flight->linkURL) {
    $linkURL = "<a href='" . formatURL($flight->linkURL, 0) . "' title='" . formatURL($flight->linkURL, 0) . "' target=_blank>" . formatURL($flight->linkURL, 15) . "</a>";
}
$flightBrandID = $row['gliderBrandID'];
//$flightBrandID=guessBrandID($flight->cat,$flight->glider);
$gliderBrandImg = brands::getBrandImg($flight->gliderBrandID, $flight->glider, $flight->cat);
$glider = $gliderBrandImg . ' ' . $flight->glider;
$gliderCat = " [ " . leoHtml::img("icon_cat_" . $flight->cat . ".png", 0, 0, 'absmiddle', '', 'icons1') . " " . $gliderCatList[$flight->cat] . " ]";
//-------------------------------------------------------------------
// get from paraglidingearth.com
//-------------------------------------------------------------------
$takoffsList = getExtrernalServerTakeoffs(1, $firstPoint->lat, -$firstPoint->lon, 50, 5);
if (count($takoffsList) > 0) {
    $linkToInfoHdr1 = "<a href='http://www.paraglidingearth.com/en-html/sites_around.php?lng=" . -$firstPoint->lon . "&lat=" . $firstPoint->lat . "&dist=20' target=_blank>";
    $linkToInfoHdr1 .= "<img src='" . $moduleRelPath . "/img/paraglidingearth_logo.gif' border=0> " . _FLYING_AREA_INFO . "</a>";
    $linkToInfoStr1 = "<ul>";
    foreach ($takoffsList as $takeoffItem) {
    $stop_reason = userCheck($allowed_requests['uname'], $email4check, $allowed_requests['pass'], $allowed_requests['vpass']);
}
if (!empty($_POST['do_register']) && empty($stop_reason_extras) && empty($stop_reason)) {
    if ($xoopsConfigUser['reg_dispdsclmr'] && empty($allowed_requests['agree_disc'])) {
        die(_US_UNEEDAGREE);
    }
    include XOOPS_ROOT_PATH . '/header.php';
    $member_handler =& xoops_gethandler('member');
    $newuser =& $member_handler->createUser();
    if ($allow_blank_email) {
        $newuser->initVar('email', XOBJ_DTYPE_TXTBOX, null, false, 60);
    }
    $newuser->setVar('user_viewemail', $allowed_requests['user_viewemail'], true);
    $newuser->setVar('uname', $allowed_requests['uname'], true);
    $newuser->setVar('email', $allowed_requests['email'], true);
    $newuser->setVar('url', formatURL($allowed_requests['url']), true);
    $newuser->setVar('user_avatar', 'blank.gif', true);
    $actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);
    $newuser->setVar('actkey', $actkey, true);
    $newuser->setVar('pass', md5($allowed_requests['pass']), true);
    $newuser->setVar('timezone_offset', $allowed_requests['timezone_offset'], true);
    $newuser->setVar('user_regdate', time(), true);
    $newuser->setVar('uorder', $xoopsConfig['com_order'], true);
    $newuser->setVar('umode', $xoopsConfig['com_mode'], true);
    $newuser->setVar('user_mailok', $allowed_requests['user_mailok'], true);
    if ($xoopsConfigUser['activation_type'] == 1) {
        $newuser->setVar('level', 1, true);
    }
    if (!$member_handler->insertUser($newuser)) {
        echo _US_REGISTERNG;
        include XOOPS_ROOT_PATH . '/footer.php';
예제 #9
0
function updateUser($uid, $uname, $name, $url, $email, $user_icq, $user_aim, $user_yim, $user_msnm, $user_from, $user_occ, $user_intrest, $user_viewemail, $user_avatar, $user_sig, $attachsig, $theme, $pass, $pass2, $rank, $bio, $uorder, $umode, $notify_method, $notify_mode, $timezone_offset, $user_mailok, $groups = array())
{
    global $xoopsConfig, $xoopsDB, $xoopsModule;
    $member_handler =& xoops_gethandler('member');
    $edituser =& $member_handler->getUser($uid);
    if ($edituser->getVar('uname') != $uname && $member_handler->getUserCount(new Criteria('uname', $uname)) > 0) {
        xoops_cp_header();
        echo 'User name ' . $uname . ' already exists';
        xoops_cp_footer();
    } else {
        $edituser->setVar("name", $name);
        $edituser->setVar("uname", $uname);
        $edituser->setVar("email", $email);
        $url = isset($url) ? formatURL($url) : '';
        $edituser->setVar("url", $url);
        //  $edituser->setVar("user_avatar", $user_avatar);
        $edituser->setVar("user_icq", $user_icq);
        $edituser->setVar("user_from", $user_from);
        $edituser->setVar("user_sig", $user_sig);
        $user_viewemail = isset($user_viewemail) && $user_viewemail == 1 ? 1 : 0;
        $edituser->setVar("user_viewemail", $user_viewemail);
        $edituser->setVar("user_aim", $user_aim);
        $edituser->setVar("user_yim", $user_yim);
        $edituser->setVar("user_msnm", $user_msnm);
        $attachsig = isset($attachsig) && $attachsig == 1 ? 1 : 0;
        $edituser->setVar("attachsig", $attachsig);
        $edituser->setVar("timezone_offset", $timezone_offset);
        //  $edituser->setVar("theme", $theme);
        $edituser->setVar("uorder", $uorder);
        $edituser->setVar("umode", $umode);
        // RMV-NOTIFY
        $edituser->setVar("notify_method", $notify_method);
        $edituser->setVar("notify_mode", $notify_mode);
        $edituser->setVar("bio", $bio);
        $edituser->setVar("rank", $rank);
        $edituser->setVar("user_occ", $user_occ);
        $edituser->setVar("user_intrest", $user_intrest);
        $edituser->setVar('user_mailok', $user_mailok);
        if ($pass2 != "") {
            if ($pass != $pass2) {
                xoops_cp_header();
                echo "\n                <strong>" . _AM_STNPDNM . "</strong>";
                xoops_cp_footer();
                exit;
            }
            $edituser->setVar("pass", md5($pass));
        }
        if (!$member_handler->insertUser($edituser)) {
            xoops_cp_header();
            echo $edituser->getHtmlErrors();
            xoops_cp_footer();
        } else {
            if ($groups != array()) {
                global $xoopsUser;
                $oldgroups = $edituser->getGroups();
                //If the edited user is the current user and the current user WAS in the webmaster's group and is NOT in the new groups array
                if ($edituser->getVar('uid') == $xoopsUser->getVar('uid') && in_array(XOOPS_GROUP_ADMIN, $oldgroups) && !in_array(XOOPS_GROUP_ADMIN, $groups)) {
                    //Add the webmaster's group to the groups array to prevent accidentally removing oneself from the webmaster's group
                    array_push($groups, XOOPS_GROUP_ADMIN);
                }
                $member_handler =& xoops_gethandler('member');
                foreach ($oldgroups as $groupid) {
                    $member_handler->removeUsersFromGroup($groupid, array($edituser->getVar('uid')));
                }
                foreach ($groups as $groupid) {
                    $member_handler->addUserToGroup($groupid, $edituser->getVar('uid'));
                }
            }
            redirect_header("admin.php?fct=users", 1, _AM_DBUPDATED);
        }
    }
    exit;
}
예제 #10
0
파일: join.php 프로젝트: amjadtbssm/website
include "header.php";
$xoopsOption['template_main'] = 'xoopspartners_join.html';
include XOOPS_ROOT_PATH . "/header.php";
$myts =& MyTextSanitizer::getInstance();
if ($xoopsUser) {
    if ($HTTP_POST_VARS['op'] == "sendMail") {
        extract($HTTP_POST_VARS);
        include XOOPS_ROOT_PATH . "/class/xoopsmailer.php";
        if (empty($title) or empty($url) or empty($description) or $url == "http://") {
            $xoopsTpl->assign(array("content4join" => _MD_ERROR1, "lang_main_partner" => _MD_PARTNERS, "sitename" => $xoopsConfig['sitename']));
            $xoopsContentsTpl = 'partnerjoin.html';
            include_once XOOPS_ROOT_PATH . '/footer.php';
            exit;
        }
        $url = formatURL($myts->makeTboxData4Show($url));
        $image = formatURL($myts->makeTboxData4Show($image));
        $title = $myts->makeTboxData4Show($title);
        $description = $myts->makeTboxData4Show($description);
        $imageInfo = @getimagesize($image);
        $imageWidth = $imageInfo[0];
        $imageHeight = $imageInfo[1];
        $type = $imageInfo[2];
        if ($type == 0) {
            $xoopsTpl->assign(array("content4join" => _MD_ERROR3, "lang_main_partner" => _MD_PARTNERS, "sitename" => $xoopsConfig['sitename']));
            $xoopsContentsTpl = 'partnerjoin.html';
            include_once XOOPS_ROOT_PATH . '/footer.php';
            exit;
        }
        if ($imageWidth >= 110 or $imageHeight >= 50) {
            $xoopsTpl->assign(array("content4join" => _MD_ERROR2, "lang_main_partner" => _MD_PARTNERS, "sitename" => $xoopsConfig['sitename']));
            $xoopsContentsTpl = 'partnerjoin.html';
예제 #11
0
파일: join.php 프로젝트: koki-h/xoops_utf8
// ------------------------------------------------------------------------- //
include "header.php";
$xoopsOption['template_main'] = 'xoopspartners_join.html';
include XOOPS_ROOT_PATH . "/header.php";
$myts =& MyTextSanitizer::getInstance();
if ($xoopsUser) {
    if (!empty($_POST['op']) && $_POST['op'] == "sendMail") {
        include XOOPS_ROOT_PATH . "/class/xoopsmailer.php";
        if (empty($_POST['title']) or empty($_POST['url']) or empty($_POST['description']) or $_POST['url'] == "http://") {
            $xoopsTpl->assign(array("content4join" => _MD_ERROR1, "lang_main_partner" => _MD_PARTNERS, "sitename" => htmlspecialchars($xoopsConfig['sitename'])));
            $xoopsContentsTpl = 'partnerjoin.html';
            include_once XOOPS_ROOT_PATH . '/footer.php';
            exit;
        }
        $url = formatURL($myts->makeTboxData4Show($_POST['url']));
        $image = formatURL($myts->makeTboxData4Show($_POST['image']));
        $title = $myts->makeTboxData4Show($_POST['title']);
        $description = $myts->makeTboxData4Show($_POST['description']);
        $imageInfo = @getimagesize($image);
        $imageWidth = $imageInfo[0];
        $imageHeight = $imageInfo[1];
        $type = $imageInfo[2];
        if ($type == 0) {
            $xoopsTpl->assign(array("content4join" => _MD_ERROR3, "lang_main_partner" => _MD_PARTNERS, "sitename" => htmlspecialchars($xoopsConfig['sitename'])));
            $xoopsContentsTpl = 'partnerjoin.html';
            include_once XOOPS_ROOT_PATH . '/footer.php';
            exit;
        }
        if ($imageWidth >= 110 or $imageHeight >= 50) {
            $xoopsTpl->assign(array("content4join" => _MD_ERROR2, "lang_main_partner" => _MD_PARTNERS, "sitename" => htmlspecialchars($xoopsConfig['sitename'])));
            $xoopsContentsTpl = 'partnerjoin.html';
예제 #12
0
    $onecat =& $categories[$id];
    $cat_element_id = "cat_" . $onecat['cat_id'];
    $expand = count($toggles) > 0 ? in_array($cat_element_id, $toggles) ? false : true : true;
    $cat_display = $expand ? 'block;' : 'none;';
    $cat_icon_display = $expand ? $category_icon["expand"] : $category_icon["collapse"];
    if (isset($forumsByCat[$onecat['cat_id']])) {
        $forums =& $forumsByCat[$onecat['cat_id']];
    }
    $cat_sponsor = array();
    @(list($url, $title) = array_map("trim", preg_split("/ /", $onecat['cat_url'], 2)));
    if (empty($title)) {
        $title = $url;
    }
    $title = $myts->htmlSpecialChars($title);
    if (!empty($url)) {
        $cat_sponsor = array("title" => $title, "link" => formatURL($url));
    }
    $cat_image = $onecat['cat_image'];
    if (!empty($cat_image) && $cat_image != "blank.gif") {
        $cat_image = XOOPS_URL . "/modules/" . $xoopsModule->getVar("dirname", "n") . "/images/category/" . $cat_image;
    } else {
        $cat_image = "";
    }
    $category_array[] = array('cat_id' => $onecat['cat_id'], 'cat_title' => $myts->displayTarea($onecat['cat_title'], 1), 'cat_image' => $cat_image, 'cat_sponsor' => $cat_sponsor, 'cat_description' => $myts->displayTarea($onecat['cat_description'], 1), 'cat_element_id' => $cat_element_id, 'cat_display' => $cat_display, 'cat_icon_display' => $cat_icon_display, 'forums' => $forums);
}
unset($categories, $forums_array, $forumsByCat);
$xoopsTpl->assign_by_ref("category_icon", $category_icon);
$xoopsTpl->assign_by_ref("categories", $category_array);
$xoopsTpl->assign(array("index_title" => sprintf(_MD_WELCOME, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)), "index_desc" => _MD_TOSTART));
/* display user stats */
$userstats = array();
예제 #13
0
function makeWaypointPlacemark($waypointID, $returnCountryCode = 0, $includeStyle = 1, $includeLookat = 1, $styleUrl = '')
{
    global $db, $waypointsTable;
    global $flightsTable, $countries, $CONF_mainfile, $moduleRelPath;
    $wpInfo = new waypoint($waypointID);
    $wpInfo->getFromDB();
    $wpName = selectWaypointName($wpInfo->name, $wpInfo->intName, $wpInfo->countryCode);
    $wpLocation = selectWaypointLocation($wpInfo->location, $wpInfo->intLocation, $wpInfo->countryCode);
    $query = "SELECT  MAX(MAX_LINEAR_DISTANCE) as record_km, ID FROM {$flightsTable}  WHERE takeoffID =" . $waypointID . " GROUP BY ID ORDER BY record_km DESC ";
    $flightNum = 0;
    $res = $db->sql_query($query);
    if ($res > 0) {
        $flightNum = mysql_num_rows($res);
        $row = $db->sql_fetchrow($res);
        $siteRecordLink = "<a href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row['ID'])) . "'>" . formatDistance($row['record_km'], 1) . "</a>";
    } else {
        $siteRecordLink = "";
    }
    $pointFlightsLink = "<a href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'list_flights', 'takeoffID' => $waypointID, 'year' => '0', 'season' => '0')) . "'>" . _See_flights_near_this_point . " [ " . $flightNum . " ]</a>";
    $countryFlightsLink = "<a href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'list_flights', 'takeoffID' => '0', 'year' => '0', 'season' => '0', 'country' => $wpInfo->countryCode)) . "'>" . $countries[$wpInfo->countryCode] . "</a>";
    if ($wpInfo->link) {
        $siteLink = '<a href="' . formatURL($wpInfo->link) . '" target="_blank">' . formatURL($wpInfo->link) . '</a>';
    } else {
        $siteLink = "-";
    }
    // "<?xml version='1.0' encoding='".$langEncodings[$currentlang]."'? >
    // <?xml version="1.0" encoding="UTF-8"? >
    $xml_text = '<Placemark>
  <name><![CDATA[' . $wpName . ' ]]></name>
  <description><![CDATA[<table cellpadding=0 cellspacing=0 width=300>' . '<tr bgcolor="#D7E1EE"><td>' . _SITE_REGION . ': ' . $wpLocation . ' - ' . $countryFlightsLink . '</td></tr>' . '<tr bgcolor="#CCCCCC"><td>' . $pointFlightsLink . '</td></tr>' . '<tr ><td>' . _SITE_RECORD . ' : ' . $siteRecordLink . '</td></tr>' . '<tr bgcolor="#CCCCCC"><td>' . _SITE_LINK . ' : ' . $siteLink . '</td></tr>' . '<tr ><td>' . $wpInfo->description . '</td></tr>' . '<tr ><td></td></tr>' . '</table>	
    ]]>
 </description>';
    if ($includeLookat) {
        $xml_text .= '
  <LookAt>
    <longitude>' . -$wpInfo->lon . '</longitude>
    <latitude>' . $wpInfo->lat . '</latitude>
    <range>10000</range>
    <tilt>0</tilt>
    <heading>0</heading>
  </LookAt>
  ';
    }
    if ($includeStyle) {
        $xml_text .= '  
  <styleUrl>root://styleMaps#default+nicon=0x307+hicon=0x317</styleUrl>
  <Style>
    <IconStyle>
      <scale>0.8</scale>
      <Icon>
        <href>root://icons/palette-4.png</href>
        <x>160</x>
        <y>128</y>
        <w>32</w>
        <h>32</h>
      </Icon>
    </IconStyle>
    <LabelStyle>
      <scale>0.8</scale>
    </LabelStyle>
  </Style>
  ';
    }
    if ($styleUrl) {
        $xml_text .= "<styleUrl>{$styleUrl}</styleUrl>\n";
    }
    $xml_text .= '
  <Point>
    <coordinates>' . -$wpInfo->lon . ',' . $wpInfo->lat . ',0</coordinates>
  </Point>
</Placemark>';
    if ($returnCountryCode) {
        return array($xml_text, $wpInfo->countryCode);
    } else {
        return $xml_text;
    }
}
function xoops_create_user($username, $password, $user, $siteinfo)
{
    xoops_load("userUtility");
    global $xoopsModuleConfig, $xoopsConfig;
    if ($xoopsModuleConfig['site_user_auth'] == 1) {
        if ($ret = check_for_lock(basename(__FILE__), $username, $password)) {
            return $ret;
        }
        if (!checkright(basename(__FILE__), $username, $password)) {
            mark_for_lock(basename(__FILE__), $username, $password);
            return array('ErrNum' => 9, "ErrDesc" => 'No Permission for plug-in');
        }
    }
    return array("Username" => $username, "password" => $password, 'user' => $user, 'siteinfo' => $siteinfo);
    if ($user['passhash'] != '') {
        if ($user['passhash'] != sha1($user['time'] - $user['rand'] . $user['uname'] . $user['pass'])) {
            return array("ERRNUM" => 4, "ERRTXT" => 'No Passhash');
        }
    } else {
        return array("ERRNUM" => 4, "ERRTXT" => 'No Passhash');
    }
    foreach ($user as $k => $l) {
        ${$k} = $l;
    }
    include_once XOOPS_ROOT_PATH . '/class/auth/authfactory.php';
    include_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/auth.php';
    $xoopsAuth =& XoopsAuthFactory::getAuthConnection($uname);
    if (check_auth_class($xoopsAuth) == true) {
        $result = $xoopsAuth->create_user($user_viewemail, $uname, $email, $url, $actkey, $pass, $timezone_offset, $user_mailok, $siteinfo);
        return $result;
    } else {
        if (strlen(userCheck($uname, $email, $pass, $pass)) == 0) {
            global $xoopsConfig;
            $config_handler =& xoops_gethandler('config');
            $xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
            $member_handler =& xoops_gethandler('member');
            $newuser =& $member_handler->createUser();
            $newuser->setVar('user_viewemail', $user_viewemail, true);
            $newuser->setVar('uname', $uname, true);
            $newuser->setVar('email', $email, true);
            if ($url != '') {
                $newuser->setVar('url', formatURL($url), true);
            }
            $newuser->setVar('user_avatar', 'blank.gif', true);
            if (empty($actkey)) {
                $actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);
            }
            $newuser->setVar('actkey', $actkey, true);
            $newuser->setVar('pass', md5($pass), true);
            $newuser->setVar('timezone_offset', $timezone_offset, true);
            $newuser->setVar('user_regdate', time(), true);
            $newuser->setVar('uorder', $xoopsConfig['com_order'], true);
            $newuser->setVar('umode', $xoopsConfig['com_mode'], true);
            $newuser->setVar('user_mailok', $user_mailok, true);
            $newuser->setVar('user_intrest', _US_USERREG . ' @ ' . $xoops_url, true);
            if ($xoopsConfigUser['activation_type'] == 1) {
                $newuser->setVar('level', 1, true);
            }
            if (!$member_handler->insertUser($newuser, true)) {
                $return = array('state' => 1, "text" => _US_REGISTERNG);
            } else {
                $newid = $newuser->getVar('uid');
                if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) {
                    $return = array('state' => 1, "text" => _US_REGISTERNG);
                }
                if ($xoopsConfigUser['activation_type'] == 1) {
                    $return = array('state' => 2, "user" => $uname);
                }
                // Sending notification email to user for self activation
                if ($xoopsConfigUser['activation_type'] == 0) {
                    $xoopsMailer =& xoops_getMailer();
                    $xoopsMailer->useMail();
                    $xoopsMailer->setTemplate('register.tpl');
                    $xoopsMailer->assign('SITENAME', $siteinfo['sitename']);
                    $xoopsMailer->assign('ADMINMAIL', $siteinfo['adminmail']);
                    $xoopsMailer->assign('SITEURL', XOOPS_URL . "/");
                    $xoopsMailer->setToUsers(new XoopsUser($newid));
                    $xoopsMailer->setFromEmail($siteinfo['adminmail']);
                    $xoopsMailer->setFromName($siteinfo['sitename']);
                    $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
                    if (!$xoopsMailer->send()) {
                        $return = array('state' => 1, "text" => _US_YOURREGMAILNG);
                    } else {
                        $return = array('state' => 1, "text" => _US_YOURREGISTERED);
                    }
                    // Sending notification email to administrator for activation
                } elseif ($xoopsConfigUser['activation_type'] == 2) {
                    $xoopsMailer =& xoops_getMailer();
                    $xoopsMailer->useMail();
                    $xoopsMailer->setTemplate('adminactivate.tpl');
                    $xoopsMailer->assign('USERNAME', $uname);
                    $xoopsMailer->assign('USEREMAIL', $email);
                    if ($siteinfo['xoops_url'] == XOOPS_URL) {
                        $xoopsMailer->assign('USERACTLINK', $siteinfo['xoops_url'] . '/register.php?op=actv&id=' . $newid . '&actkey=' . $actkey);
                    }
                } else {
                    $xoopsMailer->assign('USERACTLINK', $siteinfo['xoops_url'] . '/register.php?op=actv&uname=' . $uname . '&actkey=' . $actkey);
                }
                $xoopsMailer->assign('SITENAME', $siteinfo['sitename']);
                $xoopsMailer->assign('ADMINMAIL', $siteinfo['adminmail']);
                $xoopsMailer->assign('SITEURL', $siteinfo['xoops_url'] . "/");
                $member_handler =& xoops_gethandler('member');
                $xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['activation_group']));
                $xoopsMailer->setFromEmail($siteinfo['adminmail']);
                $xoopsMailer->setFromName($siteinfo['sitename']);
                $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
                if (!$xoopsMailer->send()) {
                    $return = array('state' => 1, "text" => _US_YOURREGMAILNG);
                } else {
                    $return = array('state' => 1, "text" => _US_YOURREGISTERED2);
                }
            }
            if ($xoopsConfigUser['new_user_notify'] == 1 && !empty($xoopsConfigUser['new_user_notify_group'])) {
                $xoopsMailer =& xoops_getMailer();
                $xoopsMailer->useMail();
                $member_handler =& xoops_gethandler('member');
                $xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['new_user_notify_group']));
                $xoopsMailer->setFromEmail($siteinfo['adminmail']);
                $xoopsMailer->setFromName($siteinfo['sitename']);
                $xoopsMailer->setSubject(sprintf(_US_NEWUSERREGAT, $xoopsConfig['sitename']));
                $xoopsMailer->setBody(sprintf(_US_HASJUSTREG, $uname));
                $xoopsMailer->send();
            }
            if (strpos(strtolower($_SERVER['HTTP_HOST']), 'xortify.com')) {
                define('XORTIFY_API_LOCAL', 'http://xortify.chronolabs.coop/soap/');
                define('XORTIFY_API_URI', 'http://xortify.chronolabs.coop/soap/');
            } else {
                define('XORTIFY_API_LOCAL', 'http://xortify.com/soap/');
                define('XORTIFY_API_URI', 'http://xortify.com/soap/');
            }
            $soap_client = @new soapclient(NULL, array('location' => XORTIFY_API_LOCAL, 'uri' => XORTIFY_API_URI));
            $result = @$soap_client->__soapCall('xoops_create_user', array("username" => $username, "password" => $password, "user" => $user, "siteinfo" => $siteinfo));
            return array("ERRNUM" => 1, "RESULT" => $return);
        } else {
            return array("ERRNUM" => 1, "RESULT" => array('state' => 1, 'text' => userCheck($uname, $email, $pass, $pass)));
        }
    }
}
예제 #15
0
$total = count($titles);
$count = 0;
foreach ($titles as $key => $value) {
    $count++;
    echo $count . "/" . $total . " - " . $value . " - " . $key . "\n";
    echo "Testando IAH - indice de Autor \n";
    $URL = "http://" . $domain . "/cgi-bin/wxis.exe/iah/?IsisScript=iah/iah.xis&base=article^d" . $value . "&index=AU&format=iso.pft&lang=i&limit=" . $key;
    $content = file_get_contents(formatURL($URL));
    getErrors($content, $URL);
    echo "Testando IAH - indice de Autor letra A \n";
    $URL = "http://" . $domain . "/cgi-bin/wxis.exe/iah/?IsisScript=iah/iah.xis&base=article^d" . $value . "&index=AU&format=iso.pft&lang=i&limit=" . $key . " &indexRoot=A&nextAction=show index&selectedIndex=^l1^nAu^pAutor^eAutor^iAuthor^xAU ^yPREINV^uAU_^mAU_&indexSearch=^nAu^pAutor^eAutor^iAuthor^xAU ^yPREINV^uAU_^mAU_";
    $content = file_get_contents(formatURL($URL));
    getErrors($content, $URL);
    echo "Testando IAH - indice de Assunto letra A \n";
    $URL = "http://" . $domain . "/cgi-bin/wxis.exe/iah/?IsisScript=iah/iah.xis&base=article^d" . $value . "&index=AU&format=iso.pft&lang=i&limit=" . $key . "&indexRoot=A&nextAction=show index&selectedIndex=^l1^nKw^pAssunto^eMateria^iSubject^xKW ^yPREINV^uKW_^mKW_&indexSearch=^nKw^pAssunto^eMateria^iSubject^xKW ^yPREINV^uKW_^mKW_";
    $content = file_get_contents(formatURL($URL));
    getErrors($content, $URL);
    echo "Testando IAH - indice de Resumo letra A \n";
    $URL = "http://" . $domain . "/cgi-bin/wxis.exe/iah/?IsisScript=iah/iah.xis&base=article^d" . $value . "&format=iso.pft&lang=i&limit=" . $key . "&indexRoot=A&nextAction=show index&selectedIndex=^l1^nAb^pResumo^eResumen^iAbstract^xAB ^yPREINV^uAB_^mAB_&indexSearch=^nAb^pResumo^eResumen^iAbstract^xAB ^yPREINV^uAB_^mAB_";
    $content = file_get_contents(formatURL($URL));
    getErrors($content, $URL);
    echo "Testando IAH - indice de Titulo letra A \n";
    $URL = "http://" . $domain . "/cgi-bin/wxis.exe/iah/?IsisScript=iah/iah.xis&base=article^d" . $value . "&format=iso.pft&lang=i&limit=" . $key . "&indexRoot=A&nextAction=show index&selectedIndex=^l1^nTi^pPalavras do título^ePalabras del título^iTitle words^xTI ^yPREINV^uTI_^mTI_&indexSearch=^nTi^pPalavras do título^ePalabras del título^iTitle words^xTI ^yPREINV^uTI_^mTI_";
    $content = file_get_contents(formatURL($URL));
    getErrors($content, $URL);
    echo "Testando IAH - indice de Ano de Publicacao \n";
    $URL = "http://" . $domain . "/cgi-bin/wxis.exe/iah/?IsisScript=iah/iah.xis&base=article^d" . $value . "&format=iso.pft&lang=i&limit=" . $key . "&nextAction=show index&selectedIndex=^l1^nYr^pAno de publicação^eAño de publicación^iPublication year^xYR ^yPREINV^uYR_^mYR_^tshort&indexSearch=^nYr^pAno de publicação^eAño de publicación^iPublication year^xYR ^yPREINV^uYR_^mYR_^tshort";
    $content = file_get_contents(formatURL($URL));
    getErrors($content, $URL);
}
echo "DONE";
예제 #16
0
 if (count($errors) > 0) {
     include XOOPS_ROOT_PATH . '/header.php';
     echo '<div>';
     foreach ($errors as $er) {
         echo '<span style="color: #ff0000; font-weight: bold;">' . $er . '</span><br />';
     }
     echo '</div><br />';
     $op = 'editprofile';
 } else {
     $member_handler =& xoops_gethandler('member');
     $edituser =& $member_handler->getUser($uid);
     $edituser->setVar('name', $name);
     if ($xoopsConfigUser['allow_chgmail'] == 1) {
         $edituser->setVar('email', $email);
     }
     $edituser->setVar('url', formatURL($url));
     $edituser->setVar('user_icq', $user_icq);
     $edituser->setVar('user_from', $user_from);
     $edituser->setVar('user_sig', $user_sig);
     $user_viewemail = !empty($user_viewemail) ? 1 : 0;
     $edituser->setVar('user_viewemail', $user_viewemail);
     $edituser->setVar('user_aim', $user_aim);
     $edituser->setVar('user_yim', $user_yim);
     $edituser->setVar('user_msnm', $user_msnm);
     if (isset($pass) && $pass != '') {
         $edituser->setVar('pass', md5($pass));
     }
     $attachsig = isset($attachsig) ? intval($attachsig) : 0;
     $edituser->setVar('attachsig', $attachsig);
     $edituser->setVar('timezone_offset', $timezone_offset);
     $edituser->setVar('uorder', $uorder);
예제 #17
0
파일: main.php 프로젝트: koki-h/xoops_utf8
 $member_handler =& xoops_gethandler('member');
 // make sure the username doesnt exist yet
 if ($member_handler->getUserCount(new Criteria('uname', addslashes($username))) > 0) {
     $adduser_errormsg = 'User name ' . $username . ' already exists';
 } else {
     $newuser =& $member_handler->createUser();
     if (isset($_POST['user_viewemail'])) {
         $newuser->setVar("user_viewemail", $_POST['user_viewemail']);
     }
     if (isset($_POST['attachsig'])) {
         $newuser->setVar("attachsig", $_POST['attachsig']);
     }
     $newuser->setVar("name", $_POST['name']);
     $newuser->setVar("uname", $_POST['username']);
     $newuser->setVar("email", $_POST['email']);
     $newuser->setVar("url", formatURL($_POST['url']));
     $newuser->setVar("user_avatar", 'blank.gif');
     $newuser->setVar("user_icq", $_POST['user_icq']);
     $newuser->setVar("user_from", $_POST['user_from']);
     $newuser->setVar("user_sig", $_POST['user_sig']);
     $newuser->setVar("user_aim", $_POST['user_aim']);
     $newuser->setVar("user_yim", $_POST['user_yim']);
     $newuser->setVar("user_msnm", $_POST['user_msnm']);
     if ($_POST['pass2'] != "") {
         if ($_POST['pass'] != $_POST['pass2']) {
             xoops_cp_header();
             echo "\n                    <b>" . _AM_STNPDNM . "</b>";
             xoops_cp_footer();
             exit;
         }
         $newuser->setVar("pass", md5($myts->stripSlashesGPC(trim($_POST['pass']))));
예제 #18
0
 }
 if ($edit) {
     $item->setVar('modified', time());
 } else {
     $item->setVar('created', time());
     $item->setVar('modified', time());
 }
 if ($edit && !$mc['aprove_edit']) {
     $item->setVar('created', time());
 }
 $item->setVar('secure', $mc['secure_public'] ? $secure : 0);
 $item->setVar('groups', $groups);
 $item->setCategories($category);
 $item->setVar('version', $version);
 $item->setVar('author_name', $author_name);
 $item->setVar('author_url', formatURL($author_url));
 $item->setVar('author_email', $author_email);
 $item->setVar('author_contact', $author_contact);
 $item->setVar('image', $image);
 $item->setVar('password', $mc['pass_public'] ? $password : '');
 $item->setVar('langs', $langs);
 $item->setTags(explode(',', $tags));
 //Licencias
 $item->setLicences($licences);
 //Plataformas
 $item->setPlatforms($platforms);
 if (!$item->save(true)) {
     redirect_header(DT_URL . ($mc['permalinks'] ? '/submit/' . ($edit ? 'edit/' . $item->id() . '/' : '') : '/p=submit' . ($edit ? '?action=edit&id=' . $id : '')), 1, __('Download item could not be saved! Please try again.', 'dtransport'));
     die;
 } else {
     if (!$edit) {
예제 #19
0
/**
* @desc Almacena los datos de un sitio
*/
function save_bookmark($edit)
{
    global $xoopsSecurity;
    if (!$xoopsSecurity->check()) {
        redirectMsg('bookmarks.php', __('Operation not allowed!', 'mw_categories'), 1);
        die;
    }
    if ($edit) {
        $id = rmc_server_var($_POST, 'id', 0);
        if ($id <= 0) {
            redirectMsg('bookmarks.php', __('Site ID not provided!', 'mywords'), 1);
            die;
        }
        $book = new MWBookmark($id);
        if ($book->isNew()) {
            redirectMsg('bookmarks.php', __('Social site not exists!', 'mywords'), 1);
            die;
        }
        $qs = '?action=edit&id=' . $id;
    } else {
        $book = new MWBookmark();
    }
    $title = rmc_server_var($_POST, 'title', '');
    $alt = rmc_server_var($_POST, 'alt', '');
    $url = rmc_server_var($_POST, 'url', '');
    $icon = rmc_server_var($_POST, 'icon', '');
    if ($title == '') {
        redirectMsg('bookmarks.php' . $qs, __('You must specify a title for this site!', 'mywords'), 1);
        die;
    }
    if ($url == '' || $url == 'http://') {
        redirectMsg('bookmarks.php' . $qs, __('You must specify a formatted URL for this site!', 'mywords'), 1);
        die;
    }
    $url = formatURL($url);
    $book->setVar('title', $title);
    $book->setVar('alt', $alt);
    $book->setVar('url', $url);
    $book->setVar('icon', $icon);
    $book->setVar('active', 1);
    if ($book->save()) {
        redirectMsg('bookmarks.php', __('Database updated successfully!', 'mywords'), 0);
    } else {
        redirectMsg('bookmarks.php' . $qs, __('Errors ocurred while trying to update database!') . '<br />' . $book->errors(), 1);
    }
}
예제 #20
0
 if (count($errors) > 0) {
     include XOOPS_ROOT_PATH . '/header.php';
     echo '<div>';
     foreach ($errors as $er) {
         echo '<span style="color: #ff0000; font-weight: bold;">' . $er . '</span><br />';
     }
     echo '</div><br />';
     $op = 'editprofile';
 } else {
     $member_handler =& xoops_gethandler('member');
     $edituser =& $member_handler->getUser($uid);
     $edituser->setVar('name', $_POST['name']);
     if ($xoopsConfigUser['allow_chgmail'] == 1) {
         $edituser->setVar('email', $email, true);
     }
     $edituser->setVar('url', formatURL($_POST['url']));
     $edituser->setVar('user_icq', $_POST['user_icq']);
     $edituser->setVar('user_from', $_POST['user_from']);
     $edituser->setVar('user_sig', xoops_substr($_POST['user_sig'], 0, 255));
     $user_viewemail = !empty($_POST['user_viewemail']) ? 1 : 0;
     $edituser->setVar('user_viewemail', $user_viewemail);
     $edituser->setVar('user_aim', $_POST['user_aim']);
     $edituser->setVar('user_yim', $_POST['user_yim']);
     $edituser->setVar('user_msnm', $_POST['user_msnm']);
     if ($password != '') {
         $edituser->setVar('pass', md5($password), true);
     }
     $attachsig = !empty($_POST['attachsig']) ? 1 : 0;
     $edituser->setVar('attachsig', $attachsig);
     $edituser->setVar('timezone_offset', $_POST['timezone_offset']);
     $edituser->setVar('uorder', $_POST['uorder']);
예제 #21
0
 /**
  * Returns a value for output of this field
  *
  * @param icms_member_user_Object $user object to get the value of
  * @param mod_profile_Profile $profile object to get the value of
  * @global array $icmsConfigAuth
  * @return mixed
  **/
 public function getOutputValue(&$user, $profile)
 {
     global $icmsConfigAuth;
     $value = in_array($this->getVar('field_name'), $this->getUserVars()) ? $user->getVar($this->getVar('field_name')) : $profile->getVar($this->getVar('field_name'));
     switch ($this->getVar('field_type')) {
         case "textarea":
         case "dhtml":
             return icms_core_DataFilter::undoHtmlSpecialChars(str_replace('&amp;', '&', $value), 1);
             break;
         case "select":
         case "radio":
             $options = unserialize($this->getVar('field_options', 'n'));
             return isset($options[$value]) ? htmlspecialchars($options[$value]) : "";
             break;
         case "select_multi":
         case "checkbox":
             $options = unserialize($this->getVar('field_options', 'n'));
             $ret = array();
             if (count($options) > 0) {
                 foreach (array_keys($options) as $key) {
                     if (in_array($key, $value)) {
                         $ret[$key] = htmlspecialchars($options[$key]);
                     }
                 }
             }
             return $ret;
             break;
         case "group":
             //change to retrieve groups and return name of group
             return $value;
             break;
         case "group_multi":
             //change to retrieve groups and return array of group names
             return "";
             break;
         case "longdate":
             //return YYYY/MM/DD format - not optimal as it is not using local date format, but how do we do that
             //when we cannot convert it to a UNIX timestamp?
             return str_replace("-", "/", $value);
         case "date":
             if ($value > 0) {
                 return formatTimestamp($value, 's');
             }
             return "";
             break;
         case "datetime":
             if ($value > 0) {
                 return formatTimestamp($value, 'm');
             }
             return "";
             break;
         case "autotext":
             $value = $user->getVar($this->getVar('field_name'), 'n');
             //autotext can have HTML in it
             $value = str_replace("{X_UID}", $user->getVar("uid"), $value);
             $value = str_replace("{X_URL}", ICMS_URL, $value);
             $value = str_replace("{X_UNAME}", $user->getVar("uname"), $value);
             return $value;
             break;
         case "rank":
             $userrank = $user->rank();
             return '<img src="' . $userrank['image'] . '" alt="' . $userrank['title'] . '" />&nbsp;' . $userrank['title'];
             break;
         case "yesno":
             return $value ? _YES : _NO;
             break;
         case "timezone":
             $timezones = icms_form_elements_select_Timezone::getTimeZoneList();
             return $timezones[str_replace('.0', '', $value)];
             break;
         case "image":
             if ($value == "") {
                 return '';
             }
             return "<img src='" . ICMS_UPLOAD_URL . "/" . basename(dirname(dirname(__FILE__))) . "/" . $value . "' alt='image' />";
             break;
         case "url":
             if ($value == "") {
                 return '';
             }
             return icms_core_DataFilter::makeClickable(formatURL($value));
         case "location":
             if ($value == "") {
                 return '';
             }
             return $value . '&nbsp;<a href="http://maps.google.com/?q=' . $value . '" target="_blank" ><img src="' . ICMS_URL . '/modules/' . basename(dirname(dirname(__FILE__))) . '/images/mapsgoogle.gif" alt="" /></a>';
         case "email":
             if ($value == "") {
                 return '';
             }
             if ($user->getVar('user_viewemail') || is_object(icms::$user) && (icms::$user->isAdmin() || icms::$user->getVar('uid') == $user->getVar('uid'))) {
                 return '<a href="mailto:' . $value . '">' . $value . '</a>';
             }
             return '';
         case "openid":
             if ($value == "") {
                 return '';
             }
             if ($icmsConfigAuth['auth_openid'] == 1 && ($user->getVar('user_viewoid') || is_object(icms::$user) && (icms::$user->isAdmin() || icms::$user->getVar('uid') == $user->getVar('uid')))) {
                 return $value;
             }
             return '';
         case "textbox":
         case "theme":
         case "language":
         default:
             return $value;
             break;
     }
 }
예제 #22
0
  font-size: 10px;
  margin-left: 20px;
}
</style>
</head>
<body>
<div id="bins">
<h2>Open</h2>
<table>
<tbody>
<?php 
$last = null;
arsort($order);
foreach ($order as $key => $value) {
    foreach ($bins[$key] as $bin) {
        $url = formatURL($bin['url'], $bin['revision']);
        preg_match('/<title>(.*?)<\\/title>/', $bin['html'], $match);
        preg_match('/<body.*?>(.*)/s', $bin['html'], $body);
        $title = '';
        if (count($body)) {
            $title = $body[1];
            if (get_magic_quotes_gpc() && $body[1]) {
                $title = stripslashes($body[1]);
            }
            $title = trim(preg_replace('/\\s+/', ' ', strip_tags($title)));
        }
        if (!$title && $bin['javascript']) {
            $title = preg_replace('/\\s+/', ' ', $bin['javascript']);
        }
        if (!$title && count($match)) {
            $title = get_magic_quotes_gpc() ? stripslashes($match[1]) : $match[1];
예제 #23
0
 

/* 	$flight->filename
		echo "<div id='geOptionsPos' style='float:right'>";
		echo "<a href='javascript:nop()' onclick=\"toggleVisible('geOptionsID','geOptionsPos',14,-80,170,'auto');return false;\">Google Earth&nbsp;<img src='".$moduleRelPath."/img/icon_arrow_down.gif' border=0></a></div>";
*/


if ($flight->comments) {
	 $comments=$flight->comments;
}

$linkURL=_N_A;
if ($flight->linkURL) {
	$linkURL="<a href='".formatURL($flight->linkURL,0)."' title='".formatURL($flight->linkURL,0)."' target=_blank>".
		formatURL($flight->linkURL,15)."</a>";
}

 	$flightBrandID=$row['gliderBrandID'];
 	//$flightBrandID=guessBrandID($flight->cat,$flight->glider);


	$gliderBrandImg=brands::getBrandImg($flight->gliderBrandID,$flight->glider,$flight->cat);
	$glider=$gliderBrandImg.' '.$flight->glider;


$gliderCat=" [ ".leoHtml::img("icon_cat_".$flight->cat.".png",0,0,'absmiddle','','icons1')." ".$gliderCatList[$flight->cat]." ]";
 
//-------------------------------------------------------------------
// get from paraglidingearth.com
//-------------------------------------------------------------------
예제 #24
0
 /**
  * Returns a value for output of this field
  *
  * @param XoopsUser $user {@link XoopsUser} object to get the value of
  * @param profileProfile $profile object to get the value of
  *
  * @return mixed
  **/
 function getOutputValue(&$user, $profile)
 {
     if (file_exists($file = $GLOBALS['xoops']->path('modules/profile/language/' . $GLOBALS['xoopsConfig']['language'] . '/modinfo.php'))) {
         include_once $file;
     } else {
         include_once $GLOBALS['xoops']->path('modules/profile/language/english/modinfo.php');
     }
     $value = in_array($this->getVar('field_name'), $this->getUserVars()) ? $user->getVar($this->getVar('field_name')) : $profile->getVar($this->getVar('field_name'));
     switch ($this->getVar('field_type')) {
         default:
         case "textbox":
             if ($this->getVar('field_name') == 'url' && $value != '') {
                 return '<a href="' . formatURL($value) . '" rel="external">' . $value . '</a>';
             } else {
                 return $value;
             }
             break;
         case "textarea":
         case "dhtml":
         case 'theme':
         case "language":
         case "list":
             return $value;
             break;
         case "select":
         case "radio":
             $options = $this->getVar('field_options');
             if (isset($options[$value])) {
                 $value = htmlspecialchars(defined($options[$value]) ? constant($options[$value]) : $options[$value]);
             } else {
                 $value = "";
             }
             return $value;
             break;
         case "select_multi":
         case "checkbox":
             $options = $this->getVar('field_options');
             $ret = array();
             if (count($options) > 0) {
                 foreach (array_keys($options) as $key) {
                     if (in_array($key, $value)) {
                         $ret[$key] = htmlspecialchars(defined($options[$key]) ? constant($options[$key]) : $options[$key]);
                     }
                 }
             }
             return $ret;
             break;
         case "group":
             $member_handler =& xoops_gethandler('member');
             $options = $member_handler->getGroupList();
             $ret = isset($options[$value]) ? $options[$value] : '';
             return $ret;
             break;
         case "group_multi":
             $member_handler =& xoops_gethandler('member');
             $options = $member_handler->getGroupList();
             $ret = array();
             foreach (array_keys($options) as $key) {
                 if (in_array($key, $value)) {
                     $ret[$key] = htmlspecialchars($options[$key]);
                 }
             }
             return $ret;
             break;
         case "longdate":
             //return YYYY/MM/DD format - not optimal as it is not using local date format, but how do we do that
             //when we cannot convert it to a UNIX timestamp?
             return str_replace("-", "/", $value);
         case "date":
             return formatTimestamp($value, 's');
             break;
         case "datetime":
             if (!empty($value)) {
                 return formatTimestamp($value, 'm');
             } else {
                 return $value = _PROFILE_MI_NEVER_LOGGED_IN;
             }
             break;
         case "autotext":
             $value = $user->getVar($this->getVar('field_name'), 'n');
             //autotext can have HTML in it
             $value = str_replace("{X_UID}", $user->getVar("uid"), $value);
             $value = str_replace("{X_URL}", XOOPS_URL, $value);
             $value = str_replace("{X_UNAME}", $user->getVar("uname"), $value);
             return $value;
             break;
         case "rank":
             $userrank = $user->rank();
             $user_rankimage = "";
             if (isset($userrank['image']) && $userrank['image'] != "") {
                 $user_rankimage = '<img src="' . XOOPS_UPLOAD_URL . '/' . $userrank['image'] . '" alt="' . $userrank['title'] . '" /><br />';
             }
             return $user_rankimage . $userrank['title'];
             break;
         case "yesno":
             return $value ? _YES : _NO;
             break;
         case "timezone":
             include_once $GLOBALS['xoops']->path('class/xoopslists.php');
             $timezones = XoopsLists::getTimeZoneList();
             $value = empty($value) ? "0" : strval($value);
             return $timezones[str_replace('.0', '', $value)];
             break;
     }
 }
예제 #25
0
/**
 * Esta función permite guardar y publicar un envío
 */
function savePage($edit = 0)
{
    global $xoopsSecurity, $xoopsUser, $myts, $mc, $xoopsModule;
    $cat = 0;
    $url = '';
    $texto = '';
    foreach ($_POST as $k => $v) {
        ${$k} = $v;
    }
    $q = "op=" . ($edit ? 'edit&id=' . $id : 'new') . "&cat={$cat}&page={$page}";
    if ($edit) {
        if ($id <= 0) {
            redirectMsg("pages.php?cat={$cat}&page={$page}", __('Page ID has not been provided', 'qpages'), 1);
            die;
        }
        $page = new QPPage($id);
        if ($page->isNew()) {
            redirectMsg("pages.php?cat={$cat}&page={$page}", __('Specified page does not exists!', 'qpages'), 1);
            die;
        }
    } else {
        $page = new QPPage();
    }
    if (!$xoopsSecurity->check()) {
        redirectMsg("pages.php?{$q}", __('Session token expired!', 'qpages'), 1);
        die;
    }
    if ($titulo == '') {
        redirectMsg("pages.php?{$q}", __('Title is missing', 'qpages'), 1);
        die;
    }
    if (isset($pretitulo)) {
        if ($pretitulo != $titulo) {
            $titulo_amigo = TextCleaner::getInstance()->sweetstring($titulo);
        } else {
            $titulo_amigo = $titulo_amigo;
        }
        $texto = TextCleaner::getInstance()->specialchars_decode($texto, ENT_QUOTES);
    } else {
        $titulo_amigo = $edit ? $titulo_amigo != '' ? $titulo_amigo : TextCleaner::getInstance()->sweetstring($titulo) : TextCleaner::getInstance()->sweetstring($titulo);
    }
    if ($texto == '' && $type == 0) {
        redirectMsg("pages.php?op=new&cat={$cat}&page={$page}", __('Content is missing', 'qpages'), 1);
        die;
    }
    if ($catego <= 0) {
        redirectMsg("pages.php?op=new&cat={$cat}&page={$page}", __('You must select a category for this page', 'qpages'), 1);
        die;
    }
    if (count($grupos) <= 0) {
        $grupos = array(0);
    }
    /**
     * Comprobamos que no exista otra página con el mismo título
     */
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $sql = "SELECT COUNT(*) FROM " . $db->prefix("qpages_pages") . " WHERE titulo_amigo='{$titulo_amigo}'";
    $sql .= $edit ? " AND id_page<>" . $page->getID() : '';
    list($num) = $db->fetchRow($db->query($sql));
    if ($num > 0) {
        $form = new RMForm(__('Review Page', 'qpages'), 'frm-review', 'pages.php');
        $form->addElement(new RMFormLabel('', __('A page with same friendly name already exists. Please change the freindly title to prevent errors.', 'qpages')));
        foreach ($_POST as $k => $v) {
            if ($k == 'titulo_amigo') {
                continue;
            }
            if ($k == 'texto') {
                continue;
            }
            if ($k == 'grupos') {
                continue;
            }
            if ($k == 'XOOPS_TOKEN_REQUEST') {
                continue;
            }
            if ($k == 'titulo') {
                $k = 'pretitulo';
            }
            $hiddens[$k] = $v;
        }
        $form->addElement(new RMFormText(__('Title', 'qpages'), 'titulo', 50, 255, $titulo), true);
        $form->addElement(new RMFormText(__('Friendly title', 'qpages'), 'titulo_amigo', 50, 255, $titulo_amigo), true);
        $form->addElement(new RMFormHidden('texto', TextCleaner::getInstance()->specialchars($texto, ENT_QUOTES)));
        foreach ($hiddens as $k => $v) {
            $form->addElement(new RMFormHidden($k, $v));
        }
        foreach ($grupos as $group) {
            $form->addElement(new RMFormHidden('grupos[]', $group));
        }
        $ele = new RMFormButtonGroup();
        $ele->addButton('sbt', __('Save Page', 'qpages'), 'submit');
        $ele->addButton('cancel', __('Cancel', 'qpages'), 'button', 'onclick="history.go(-1);"');
        $form->addElement($ele);
        qpages_toolbar();
        xoops_cp_header();
        $form->display();
        xoops_cp_footer();
        die;
    }
    #Guardamos los datos del Post
    $page->setTitle($titulo);
    $page->setFriendTitle($titulo_amigo);
    $page->setDate($edit ? $page->getVar('fecha') : time());
    $page->setModDate(time());
    $page->setText($texto);
    $page->setCategory($catego);
    $page->setVar('desc', TextCleaner::getInstance()->clean_disabled_tags($desc));
    $page->setGroups($grupos);
    $page->setHTML(isset($dohtml) ? 1 : 0);
    $page->setXCode(isset($doxcode) ? 1 : 0);
    $page->setImage(isset($doimage) ? 1 : 0);
    $page->setBR(isset($dobr) ? 1 : 0);
    $page->setSmiley(isset($dosmiley) ? 1 : 0);
    $page->setUid($xoopsUser->uid());
    $page->setType($type);
    $page->setURL(formatURL($url));
    $page->setAccess($acceso);
    // Add Metas
    foreach ($meta_name as $k => $v) {
        $page->add_meta($v, $meta_value[$k]);
    }
    $ret = $edit ? $page->update() : $page->save();
    if ($ret) {
        $xoopsUser->incrementPost();
        redirectMsg("pages.php?op=" . ($page->type() ? 'editlink' : 'edit') . "&id=" . $page->getID() . "&cat={$cat}&page={$page}", __('Database updated successfully!', 'qpages'), 0);
    } else {
        redirectMsg("pages.php?{$q}", __('Errors ocurred while trying to update database', 'qpages') . "<br />" . $page->errors(), 1);
    }
}
예제 #26
0
function dispatch()
{
	require XSNS_FRAMEWORK_DIR.'/global.php';
	require_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/user.php';
	$ts =& XsnsTextSanitizer::getInstance();
	
	if($this->isGuest() || !$this->validateToken('edituser')){
		redirect_header(XSNS_URL_MYPAGE, 3, _US_NOEDITRIGHT);
	}
	$config_handler =& xoops_gethandler('config');
	if(defined('XOOPS_CUBE_LEGACY')){
		$xoopsConfigUser =& $config_handler->getConfigsByDirname('user');
		$user_config =& $xoopsConfigUser;
	}
	else{
		$xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
		$user_config =& $xoopsConfig;
	}
	if(!is_array($xoopsConfigUser)){
		redirect_header(XSNS_URL_MYPAGE, 3, _US_NOEDITRIGHT);
	}
	
	$uid = 0;
	if (!empty($_POST['uid'])) {
		$uid = intval($_POST['uid']);
	}
	if (empty($uid) || $xoopsUser->getVar('uid') != $uid) {
		redirect_header(XSNS_URL_MYPAGE, 3, _US_NOEDITRIGHT);
	}
	$errors = array();
	if ($xoopsConfigUser['allow_chgmail'] == 1) {
		$email = '';
		if (!empty($_POST['email'])) {
			$email = $ts->stripSlashesGPC(trim($_POST['email']));
		}
		if ($email == '' || !checkEmail($email)) {
			$errors[] = _US_INVALIDMAIL;
		}
	}
	$password = '';
	if (!empty($_POST['password'])) {
		$password = $ts->stripSlashesGPC(trim($_POST['password']));
	}
	if ($password != '') {
		if (strlen($password) < $xoopsConfigUser['minpass']) {
			$errors[] = sprintf(_US_PWDTOOSHORT,$xoopsConfigUser['minpass']);
		}
		$vpass = '';
		if (!empty($_POST['vpass'])) {
			$vpass = $ts->stripSlashesGPC(trim($_POST['vpass']));
		}
		if ($password != $vpass) {
			$errors[] = _US_PASSNOTSAME;
		}
	}
	if (count($errors) > 0) {
		redirect_header(XSNS_URL_MYPAGE, 3, _US_NOEDITRIGHT);
	}
	else {
		$member_handler =& xoops_gethandler('member');
		$edituser =& $member_handler->getUser($uid);
		if(!is_object($edituser)){
			redirect_header(XSNS_URL_MYPAGE, 3, _US_NOEDITRIGHT);
		}
		
		$vars = array(
			'name' => isset($_POST['name']) ? $_POST['name'] : '',
			'url' => isset($_POST['url']) ? formatURL($_POST['url']) : '',
			'user_icq' => isset($_POST['user_icq']) ? $_POST['user_icq'] : '',
			'user_from' => isset($_POST['user_from']) ? $_POST['user_from'] : '',
			'user_viewemail' => !empty($_POST['user_viewemail']) ? 1 : 0,
			'user_aim' => isset($_POST['user_aim']) ? $_POST['user_aim'] : '',
			'user_yim' => isset($_POST['user_yim']) ? $_POST['user_yim'] : '',
			'user_msnm' => isset($_POST['user_msnm']) ? $_POST['user_msnm'] : '',
			'attachsig' => !empty($_POST['attachsig']) ? 1 : 0,
			'timezone_offset' => isset($_POST['timezone_offset']) ? $_POST['timezone_offset'] : 0.0,
			'user_occ' => isset($_POST['user_occ']) ? $_POST['user_occ'] : '',
			'user_intrest' => isset($_POST['user_intrest']) ? $_POST['user_intrest'] : '',
			'user_sig' => isset($_POST['user_sig']) ? xoops_substr($_POST['user_sig'], 0, 255) : '',
			'uorder' => isset($_POST['uorder']) ? $_POST['uorder'] : 0,
			'umode' => isset($_POST['umode']) ? $_POST['umode'] : 0,
			'notify_method' => isset($_POST['notify_method']) ? $_POST['notify_method'] : 1,
			'notify_mode' => isset($_POST['notify_mode']) ? $_POST['notify_mode'] : 0,
			'bio' => isset($_POST['bio']) ? xoops_substr($_POST['bio'], 0, 255) : '',
			'user_mailok' => !empty($_POST['user_mailok']) ? 1 : 0,
		);
		
		if ($xoopsConfigUser['allow_chgmail'] == 1) {
			$vars['email'] = $email;
		}
		if(!empty($password)){
			$vars['pass'] = md5($password);
		}
		
		$edituser->setVars($vars);
		
		if(!empty($user_config['usercookie'])){
			if (!empty($_POST['usercookie'])) {
				setcookie($user_config['usercookie'], $xoopsUser->getVar('uname'), time()+ 31536000);
			}
			else {
				setcookie($user_config['usercookie']);
			}
		}
		
		if (!$member_handler->insertUser($edituser)) {
			redirect_header(XSNS_URL_MYPAGE, 3, _US_NOEDITRIGHT);
		}
		else {
			redirect_header(XSNS_URL_MYPAGE, 2, _US_PROFUPDATED);
		}
	}
}
         $errors[] = sprintf(_MD_XOONIPS_ACCOUNT_MUST_BE_FILLED_IN, $label);
     }
 }
 if (count($errors) > 0) {
     $op = 'editprofile';
     // TODO: check here
 } else {
     // set new values
     // - xoops user information
     $u_obj->setVar('name', $realname, true);
     // not gpc
     if ($myxoopsConfigUser['allow_chgmail'] == 1) {
         $u_obj->setVar('email', $email, true);
         // not gpc
     }
     $u_obj->setVar('url', formatURL($url), true);
     // not gpc
     $u_obj->setVar('user_sig', xoops_substr($user_sig, 0, 255), true);
     // not gpc
     $user_viewemail = empty($user_viewemail) ? 0 : 1;
     $u_obj->setVar('user_viewemail', $user_viewemail, true);
     // not gpc
     if ($vpass != '') {
         $u_obj->setVar('pass', md5($password), true);
         // not gpc
     }
     $attachsig = empty($attachsig) ? 0 : 1;
     $u_obj->setVar('attachsig', $attachsig, true);
     // not gpc
     $u_obj->setVar('timezone_offset', $timezone_offset, true);
     // not gpc
예제 #28
0
파일: index.php 프로젝트: koki-h/xoops_utf8
function addDownload()
{
    global $xoopsDB, $xoopsUser, $xoopsModule, $myts, $eh;
    $url = $myts->makeTboxData4Save(formatURL($_POST["url"]));
    $logourl = $myts->makeTboxData4Save($_POST["logourl"]);
    $title = $myts->makeTboxData4Save($_POST["title"]);
    $homepage = $myts->makeTboxData4Save(formatURL($_POST["homepage"]));
    $version = $myts->makeTboxData4Save($_POST["version"]);
    $size = $myts->makeTboxData4Save($_POST["size"]);
    $platform = $myts->makeTboxData4Save($_POST["platform"]);
    $description = $myts->makeTareaData4Save($_POST["description"]);
    $submitter = $xoopsUser->uid();
    $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("mydownloads_downloads") . " WHERE url='{$url}'");
    list($numrows) = $xoopsDB->fetchRow($result);
    $error = 0;
    $errormsg = "";
    if ($numrows > 0) {
        $errormsg .= "<h4 style='color: #ff0000'>";
        $errormsg .= _MD_ERROREXIST . "</h4><br />";
        $error = 1;
    }
    // Check if Title exist
    if ($title == "") {
        $errormsg .= "<h4 style='color: #ff0000'>";
        $errormsg .= _MD_ERRORTITLE . "</h4><br />";
        $error = 1;
    }
    if (empty($size) || !is_numeric($size)) {
        $size = 0;
    }
    // Check if Description exist
    if ($description == "") {
        $errormsg .= "<h4 style='color: #ff0000'>";
        $errormsg .= _MD_ERRORDESC . "</h4><br />";
        $error = 1;
    }
    if ($error == 1) {
        xoops_cp_header();
        echo $errormsg;
        xoops_cp_footer();
        exit;
    }
    if (!empty($_POST['cid'])) {
        $cid = $_POST['cid'];
    } else {
        $cid = 0;
    }
    $newid = $xoopsDB->genId($xoopsDB->prefix("mydownloads_downloads") . "_lid_seq");
    $sql = sprintf("INSERT INTO %s (lid, cid, title, url, homepage, version, size, platform, logourl, submitter, status, date, hits, rating, votes, comments) VALUES (%u, %u, '%s', '%s', '%s', '%s', %u, '%s', '%s', %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix("mydownloads_downloads"), $newid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $submitter, 1, time(), 0, 0, 0, 0);
    $xoopsDB->query($sql) or $eh->show("0013");
    if ($newid == 0) {
        $newid = $xoopsDB->getInsertId();
    }
    $sql = sprintf("INSERT INTO %s (lid, description) VALUES (%u, '%s')", $xoopsDB->prefix("mydownloads_text"), $newid, $description);
    $xoopsDB->query($sql) or $eh->show("0013");
    $tags = array();
    $tags['FILE_NAME'] = $title;
    $tags['FILE_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlefile.php?cid=' . $cid . '&amp;lid=' . $newid;
    $sql = "SELECT title FROM " . $xoopsDB->prefix("mydownloads_cat") . " WHERE cid=" . $cid;
    $result = $xoopsDB->query($sql);
    $row = $xoopsDB->fetchArray($result);
    $tags['CATEGORY_NAME'] = $row['title'];
    $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
    $notification_handler =& xoops_gethandler('notification');
    $notification_handler->triggerEvent('global', 0, 'new_file', $tags);
    $notification_handler->triggerEvent('category', $cid, 'new_file', $tags);
    redirect_header("index.php?op=downloadsConfigMenu", 1, _MD_NEWDLADDED);
}
예제 #29
0
                 $criteria->add(new Criteria($var, $value . '%', 'LIKE'));
                 break;
             case XOOPS_MATCH_END:
                 $criteria->add(new Criteria($var, '%' . $value, 'LIKE'));
                 break;
             case XOOPS_MATCH_EQUAL:
                 $criteria->add(new Criteria($var, $value));
                 break;
             case XOOPS_MATCH_CONTAIN:
                 $criteria->add(new Criteria($var, '%' . $value . '%', 'LIKE'));
                 break;
         }
     }
 }
 if (!empty($_POST['url'])) {
     $url = formatURL(trim($_POST['url']));
     $criteria->add(new Criteria('url', $url . '%', 'LIKE'));
 }
 if (!empty($_POST['user_from'])) {
     $criteria->add(new Criteria('user_from', '%' . $myts->addSlashes(trim($_POST['user_from'])) . '%', 'LIKE'));
 }
 if (!empty($_POST['user_intrest'])) {
     $criteria->add(new Criteria('user_intrest', '%' . $myts->addSlashes(trim($_POST['user_intrest'])) . '%', 'LIKE'));
 }
 if (!empty($_POST['user_occ'])) {
     $criteria->add(new Criteria('user_occ', '%' . $myts->addSlashes(trim($_POST['user_occ'])) . '%', 'LIKE'));
 }
 foreach (array("last_login", "user_regdate") as $var) {
     if (!empty($_POST["{$var}_more"]) && is_numeric($_POST["{$var}_more"])) {
         $time = time() - 60 * 60 * 24 * intval(trim($_POST["{$var}_more"]));
         if ($time > 0) {
예제 #30
0
파일: main.php 프로젝트: nao-pon/impresscms
				break;
				
			case XOOPS_MATCH_EQUAL:
				$criteria->add(new icms_db_criteria_Item('email', icms_core_DataFilter::addSlashes(trim($user_email))));
				break;
				
			case XOOPS_MATCH_CONTAIN:
				$criteria->add(new icms_db_criteria_Item('email', '%' . icms_core_DataFilter::addSlashes(trim($user_email)) . '%', 'LIKE'));
				break;
				
			default:
				break;
		}
	}
	if (!empty($user_url)) {
		$url = formatURL(trim($user_url));
		$criteria->add(new icms_db_criteria_Item('url', $url . '%', 'LIKE'));
	}
	if (!empty($user_icq)) {
		$match = (!empty($user_icq_match)) ? (int) $user_icq_match : XOOPS_MATCH_START;
		switch ($match) {
			case XOOPS_MATCH_START:
				$criteria->add(new icms_db_criteria_Item('user_icq', icms_core_DataFilter::addSlashes(trim($user_icq)) . '%', 'LIKE'));
				break;
				
			case XOOPS_MATCH_END:
				$criteria->add(new icms_db_criteria_Item('user_icq', '%' . icms_core_DataFilter::addSlashes(trim($user_icq)), 'LIKE'));
				break;
				
			case XOOPS_MATCH_EQUAL:
				$criteria->add(new icms_db_criteria_Item('user_icq', '%' . icms_core_DataFilter::addSlashes(trim($user_icq))));