mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
issue 2662 member, layout
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12251 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
aba8de04be
commit
cec308eef1
15 changed files with 8864 additions and 8331 deletions
|
|
@ -3,15 +3,15 @@
|
|||
* @class layoutAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* admin controller class of the layout module
|
||||
**/
|
||||
|
||||
class layoutAdminController extends layout {
|
||||
|
||||
*/
|
||||
class layoutAdminController extends layout
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -19,8 +19,9 @@
|
|||
* Insert a title into "layouts" table in order to create a layout
|
||||
* @deprecated
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procLayoutAdminInsert() {
|
||||
*/
|
||||
function procLayoutAdminInsert()
|
||||
{
|
||||
if(Context::get('layout') == 'faceoff') return $this->stop('not supported');
|
||||
|
||||
// Get information to create a layout
|
||||
|
|
@ -51,8 +52,9 @@
|
|||
* Insert layout information into the DB
|
||||
* @param object $args layout information
|
||||
* @return Object
|
||||
**/
|
||||
function insertLayout($args) {
|
||||
*/
|
||||
function insertLayout($args)
|
||||
{
|
||||
$output = executeQuery("layout.insertLayout", $args);
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -62,14 +64,18 @@
|
|||
* @param int $layout_srl
|
||||
* @param string $layout_name
|
||||
* @return void
|
||||
**/
|
||||
function initLayout($layout_srl, $layout_name){
|
||||
*/
|
||||
function initLayout($layout_srl, $layout_name)
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
// Import a sample layout if it is faceoff
|
||||
if($oLayoutModel->useDefaultLayout($layout_name)) {
|
||||
if($oLayoutModel->useDefaultLayout($layout_name))
|
||||
{
|
||||
$this->importLayout($layout_srl, $this->module_path.'tpl/faceOff_sample.tar');
|
||||
// Remove a directory
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
FileHandler::removeDir($oLayoutModel->getUserLayoutPath($layout_srl));
|
||||
}
|
||||
}
|
||||
|
|
@ -78,8 +84,9 @@
|
|||
* Update layout information
|
||||
* Apply a title of the new layout and extra vars
|
||||
* @return Object
|
||||
**/
|
||||
function procLayoutAdminUpdate() {
|
||||
*/
|
||||
function procLayoutAdminUpdate()
|
||||
{
|
||||
// Consider the rest of items as extra vars, except module, act, layout_srl, layout, and title .. Some gurida ..
|
||||
$extra_vars = Context::getRequestVars();
|
||||
unset($extra_vars->module);
|
||||
|
|
@ -99,11 +106,14 @@
|
|||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$layout_info = $oLayoutModel->getLayout($args->layout_srl);
|
||||
|
||||
if($layout_info->menu) {
|
||||
if($layout_info->menu)
|
||||
{
|
||||
$menus = get_object_vars($layout_info->menu);
|
||||
}
|
||||
if(count($menus) ) {
|
||||
foreach($menus as $menu_id => $val) {
|
||||
if(count($menus))
|
||||
{
|
||||
foreach($menus as $menu_id => $val)
|
||||
{
|
||||
$menu_srl = Context::get($menu_id);
|
||||
if(!$menu_srl) continue;
|
||||
|
||||
|
|
@ -114,20 +124,25 @@
|
|||
$apply_layout = Context::get('apply_layout');
|
||||
$apply_mobile_view = Context::get('apply_mobile_view');
|
||||
|
||||
if($apply_layout=='Y' || $apply_mobile_view=='Y') {
|
||||
if($apply_layout=='Y' || $apply_mobile_view=='Y')
|
||||
{
|
||||
$menu_args = null;
|
||||
$menu_args->menu_srl = $menu_srl;
|
||||
$menu_args->site_srl = $layout_info->site_srl;
|
||||
$output = executeQueryArray('layout.getLayoutModules', $menu_args);
|
||||
if($output->data) {
|
||||
if($output->data)
|
||||
{
|
||||
$modules = array();
|
||||
for($i=0;$i<count($output->data);$i++) {
|
||||
for($i=0;$i<count($output->data);$i++)
|
||||
{
|
||||
$modules[] = $output->data[$i]->module_srl;
|
||||
}
|
||||
|
||||
if(count($modules)) {
|
||||
if(count($modules))
|
||||
{
|
||||
$update_args->module_srls = implode(',',$modules);
|
||||
if($apply_layout == "Y") {
|
||||
if($apply_layout == "Y")
|
||||
{
|
||||
$update_args->layout_srl = $args->layout_srl;
|
||||
}
|
||||
if($layout_info->layout_type == "M")
|
||||
|
|
@ -150,8 +165,10 @@
|
|||
|
||||
$tmpDir = sprintf('./files/attach/images/%s/tmp', $args->layout_srl);
|
||||
// Separately handle if a type of extra_vars is an image
|
||||
if($layout_info->extra_var) {
|
||||
foreach($layout_info->extra_var as $name => $vars) {
|
||||
if($layout_info->extra_var)
|
||||
{
|
||||
foreach($layout_info->extra_var as $name => $vars)
|
||||
{
|
||||
if($vars->type!='image') continue;
|
||||
|
||||
$fileName = $extra_vars->{$name};
|
||||
|
|
@ -211,10 +228,11 @@
|
|||
* Update layout information into the DB
|
||||
* @param object $args
|
||||
* @return Object
|
||||
**/
|
||||
*/
|
||||
function updateLayout($args) {
|
||||
$output = executeQuery('layout.updateLayout', $args);
|
||||
if($output->toBool()) {
|
||||
if($output->toBool())
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$cache_file = $oLayoutModel->getUserLayoutCache($args->layout_srl, Context::getLangType());
|
||||
FileHandler::removeFile($cache_file);
|
||||
|
|
@ -233,8 +251,9 @@
|
|||
* Delete Layout
|
||||
* Delete xml cache file too when deleting a layout
|
||||
* @return Object
|
||||
**/
|
||||
function procLayoutAdminDelete() {
|
||||
*/
|
||||
function procLayoutAdminDelete()
|
||||
{
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
return $this->deleteLayout($layout_srl);
|
||||
|
|
@ -244,8 +263,9 @@
|
|||
* Delete layout xml cache file
|
||||
* @param int $layout_srl
|
||||
* @return Object
|
||||
**/
|
||||
function deleteLayout($layout_srl, $force = FALSE) {
|
||||
*/
|
||||
function deleteLayout($layout_srl, $force = FALSE)
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
||||
if(!$force)
|
||||
|
|
@ -284,8 +304,9 @@
|
|||
/**
|
||||
* Adding Layout Code
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procLayoutAdminCodeUpdate() {
|
||||
*/
|
||||
function procLayoutAdminCodeUpdate()
|
||||
{
|
||||
$mode = Context::get('mode');
|
||||
if ($mode == 'reset')
|
||||
{
|
||||
|
|
@ -316,8 +337,9 @@
|
|||
/**
|
||||
* Reset layout code
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procLayoutAdminCodeReset() {
|
||||
*/
|
||||
function procLayoutAdminCodeReset()
|
||||
{
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
if(!$layout_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
|
|
@ -329,7 +351,8 @@
|
|||
$info = $oLayoutModel->getLayout($layout_srl);
|
||||
|
||||
// if face off delete, tmp file
|
||||
if($oLayoutModel->useDefaultLayout($info->layout)){
|
||||
if($oLayoutModel->useDefaultLayout($info->layout))
|
||||
{
|
||||
$this->deleteUserLayoutTempFile($layout_srl);
|
||||
$faceoff_css = $oLayoutModel->getUserLayoutFaceOffCss($layout_srl);
|
||||
FileHandler::removeFile($faceoff_css);
|
||||
|
|
@ -340,12 +363,12 @@
|
|||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Layout setting page -> Upload an image
|
||||
* @return void
|
||||
**/
|
||||
function procLayoutAdminUserImageUpload(){
|
||||
*/
|
||||
function procLayoutAdminUserImageUpload()
|
||||
{
|
||||
if(!Context::isUploaded()) exit();
|
||||
|
||||
$image = Context::get('user_layout_image');
|
||||
|
|
@ -364,14 +387,16 @@
|
|||
* @param int $layout_srl
|
||||
* @param object $source file data
|
||||
* @return boolean (true : success, false : fail)
|
||||
**/
|
||||
function insertUserLayoutImage($layout_srl,$source){
|
||||
*/
|
||||
function insertUserLayoutImage($layout_srl,$source)
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$path = $oLayoutModel->getUserLayoutImagePath($layout_srl);
|
||||
if(!is_dir($path)) FileHandler::makeDir($path);
|
||||
|
||||
$filename = strtolower($source['name']);
|
||||
if($filename != urlencode($filename)){
|
||||
if($filename != urlencode($filename))
|
||||
{
|
||||
$ext = substr(strrchr($filename,'.'),1);
|
||||
$filename = sprintf('%s.%s', md5($filename), $ext);
|
||||
}
|
||||
|
|
@ -384,8 +409,9 @@
|
|||
/**
|
||||
* Layout setting page -> Delete an image
|
||||
* @return void
|
||||
**/
|
||||
function procLayoutAdminUserImageDelete(){
|
||||
*/
|
||||
function procLayoutAdminUserImageDelete()
|
||||
{
|
||||
$filename = Context::get('filename');
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$this->removeUserLayoutImage($layout_srl,$filename);
|
||||
|
|
@ -398,8 +424,9 @@
|
|||
* @param int $layout_srl
|
||||
* @param string $filename
|
||||
* @return void
|
||||
**/
|
||||
function removeUserLayoutImage($layout_srl,$filename){
|
||||
*/
|
||||
function removeUserLayoutImage($layout_srl,$filename)
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$path = $oLayoutModel->getUserLayoutImagePath($layout_srl);
|
||||
@unlink($path . $filename);
|
||||
|
|
@ -411,8 +438,9 @@
|
|||
* save in "ini" format for faceoff
|
||||
* @deprecated
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procLayoutAdminUserValueInsert(){
|
||||
*/
|
||||
function procLayoutAdminUserValueInsert()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
$mid = Context::get('mid');
|
||||
|
|
@ -428,9 +456,12 @@
|
|||
|
||||
// save tmp?
|
||||
$temp = Context::get('saveTemp');
|
||||
if($temp =='Y'){
|
||||
if($temp =='Y')
|
||||
{
|
||||
$oLayoutModel->setUseUserLayoutTemp();
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
// delete temp files
|
||||
$this->deleteUserLayoutTempFile($layout_srl);
|
||||
}
|
||||
|
|
@ -464,8 +495,9 @@
|
|||
* @param int $layout_srl
|
||||
* @param object $arr layout ini
|
||||
* @return void
|
||||
**/
|
||||
function insertUserLayoutValue($layout_srl,$arr){
|
||||
*/
|
||||
function insertUserLayoutValue($layout_srl,$arr)
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$file = $oLayoutModel->getUserLayoutIni($layout_srl);
|
||||
FileHandler::writeIniFile($file, $arr);
|
||||
|
|
@ -477,8 +509,9 @@
|
|||
* @param object $arg
|
||||
* @param string $content
|
||||
* @return string
|
||||
**/
|
||||
function addExtension($layout_srl,$arg,$content){
|
||||
*/
|
||||
function addExtension($layout_srl,$arg,$content)
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$reg = '/(<\!\-\- start\-e1 \-\->)(.*)(<\!\-\- end\-e1 \-\->)/i';
|
||||
$extension_content = '\1' .stripslashes($arg->e1) . '\3';
|
||||
|
|
@ -498,16 +531,17 @@
|
|||
return $content;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete temp files for faceoff
|
||||
* @param int $layout_srl
|
||||
* @return void
|
||||
**/
|
||||
function deleteUserLayoutTempFile($layout_srl){
|
||||
*/
|
||||
function deleteUserLayoutTempFile($layout_srl)
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$file_list = $oLayoutModel->getUserLayoutTempFileList($layout_srl);
|
||||
foreach($file_list as $key => $file){
|
||||
foreach($file_list as $key => $file)
|
||||
{
|
||||
FileHandler::removeFile($file);
|
||||
}
|
||||
}
|
||||
|
|
@ -515,8 +549,9 @@
|
|||
/**
|
||||
* export user layout
|
||||
* @return void
|
||||
**/
|
||||
function procLayoutAdminUserLayoutExport(){
|
||||
*/
|
||||
function procLayoutAdminUserLayoutExport()
|
||||
{
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
if(!$layout_srl) return new Object('-1','msg_invalid_request');
|
||||
|
||||
|
|
@ -610,8 +645,9 @@
|
|||
* faceoff import
|
||||
* @deprecated
|
||||
* @return void
|
||||
**/
|
||||
function procLayoutAdminUserLayoutImport(){
|
||||
*/
|
||||
function procLayoutAdminUserLayoutImport()
|
||||
{
|
||||
return $this->stop('not supported');
|
||||
|
||||
// check upload
|
||||
|
|
@ -790,12 +826,14 @@
|
|||
* @param int $layout_srl
|
||||
* @param string $source_file path of imported file
|
||||
* @return void
|
||||
**/
|
||||
function importLayout($layout_srl, $source_file) {
|
||||
*/
|
||||
function importLayout($layout_srl, $source_file)
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($layout_srl));
|
||||
$file_list = $oLayoutModel->getUserLayoutFileList($layout_srl);
|
||||
foreach($file_list as $key => $file){
|
||||
foreach($file_list as $key => $file)
|
||||
{
|
||||
FileHandler::removeFile($user_layout_path . $file);
|
||||
}
|
||||
|
||||
|
|
@ -808,7 +846,8 @@
|
|||
if(!$tar->getFile('layout.ini')) return;
|
||||
|
||||
$replace_path = getNumberingPath($layout_srl,3);
|
||||
foreach($tar->files as $key => $info) {
|
||||
foreach($tar->files as $key => $info)
|
||||
{
|
||||
FileHandler::writeFile($user_layout_path . $info['name'],str_replace('__LAYOUT_PATH__',$replace_path,$info['file']));
|
||||
}
|
||||
// Remove uploaded file
|
||||
|
|
@ -900,4 +939,5 @@
|
|||
Context::set('name', $name);
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file layout.admin.controller.php */
|
||||
/* Location: ./modules/layout/layout.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -3,10 +3,9 @@
|
|||
* @class layoutAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* admin view class of the layout module
|
||||
**/
|
||||
|
||||
class layoutAdminModel extends layout {
|
||||
|
||||
*/
|
||||
class layoutAdminModel extends layout
|
||||
{
|
||||
/**
|
||||
* init
|
||||
*/
|
||||
|
|
@ -127,7 +126,6 @@ class layoutAdminModel extends layout {
|
|||
$widget_list = $oWidgetModel->getDownloadedWidgetList();
|
||||
Context::set('widget_list', $widget_list);
|
||||
|
||||
|
||||
$security = new Security($layout_info);
|
||||
$layout_info = $security->encodeHTML('.', '.author..');
|
||||
Context::set('selected_layout', $layout_info);
|
||||
|
|
@ -175,3 +173,5 @@ class layoutAdminModel extends layout {
|
|||
return $designInfo->{$target};
|
||||
}
|
||||
}
|
||||
/* End of file layout.admin.model.php */
|
||||
/* Location: ./modules/layout/layout.admin.model.php */
|
||||
|
|
|
|||
|
|
@ -3,23 +3,24 @@
|
|||
* @class layoutAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* admin view class of the layout module
|
||||
**/
|
||||
|
||||
class layoutAdminView extends layout {
|
||||
|
||||
*/
|
||||
class layoutAdminView extends layout
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a installed layout list
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminInstalledList() {
|
||||
*/
|
||||
function dispLayoutAdminInstalledList()
|
||||
{
|
||||
$type = Context::get('type');
|
||||
$type = ($type != 'M') ? 'P' : 'M';
|
||||
|
||||
|
|
@ -37,7 +38,8 @@
|
|||
$oAdminModel = &getAdminModel('admin');
|
||||
$themeList = $oAdminModel->getThemeList();
|
||||
$themeLayoutList = array();
|
||||
foreach($themeList as $themeInfo){
|
||||
foreach($themeList as $themeInfo)
|
||||
{
|
||||
if(strpos($themeInfo->layout_info->name, '.') === false) continue;
|
||||
$themeLayoutList[] = $oLayoutModel->getLayoutInfo($themeInfo->layout_info->name, null, 'P');
|
||||
}
|
||||
|
|
@ -159,8 +161,9 @@
|
|||
* Layout setting page
|
||||
* Once select a layout with empty value in the DB, then adjust values
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function dispLayoutAdminInsert() {
|
||||
*/
|
||||
function dispLayoutAdminInsert()
|
||||
{
|
||||
$oModel = &getModel('layout');
|
||||
$type = Context::get('type');
|
||||
if(!in_array($type, array('P', 'M'))) $type = 'P';
|
||||
|
|
@ -202,8 +205,9 @@
|
|||
/**
|
||||
* Insert Layout details
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminModify() {
|
||||
*/
|
||||
function dispLayoutAdminModify()
|
||||
{
|
||||
$oLayoutAdminModel = &getAdminModel('layout');
|
||||
$oLayoutAdminModel->setLayoutAdminSetInfoView();
|
||||
|
||||
|
|
@ -220,8 +224,9 @@
|
|||
/**
|
||||
* Edit layout codes
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminEdit() {
|
||||
*/
|
||||
function dispLayoutAdminEdit()
|
||||
{
|
||||
// Set the layout with its information
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
// Get layout information
|
||||
|
|
@ -233,17 +238,22 @@
|
|||
// Get Layout Code
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl);
|
||||
if(!file_exists($layout_file)){
|
||||
if(!file_exists($layout_file))
|
||||
{
|
||||
// If faceoff
|
||||
if($oLayoutModel->useDefaultLayout($layout_info->layout_srl)){
|
||||
if($oLayoutModel->useDefaultLayout($layout_info->layout_srl))
|
||||
{
|
||||
$layout_file = $oLayoutModel->getDefaultLayoutHtml($layout_info->layout);
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
$layout_file = sprintf('%s%s', $layout_info->path, 'layout.html');
|
||||
}
|
||||
}
|
||||
|
||||
$layout_css_file = $oLayoutModel->getUserLayoutCss($layout_info->layout_srl);
|
||||
if(file_exists($layout_css_file)){
|
||||
if(file_exists($layout_css_file))
|
||||
{
|
||||
$layout_code_css = FileHandler::readFile($layout_css_file);
|
||||
Context::set('layout_code_css', $layout_code_css);
|
||||
}
|
||||
|
|
@ -280,8 +290,9 @@
|
|||
/**
|
||||
* Preview a layout
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function dispLayoutAdminPreview() {
|
||||
*/
|
||||
function dispLayoutAdminPreview()
|
||||
{
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$code = Context::get('code');
|
||||
$code_css = Context::get('code_css');
|
||||
|
|
@ -295,14 +306,18 @@
|
|||
// Apply CSS directly
|
||||
Context::addHtmlHeader("<style type=\"text/css\" charset=\"UTF-8\">".$code_css."</style>");
|
||||
// Set names and values of extra_vars to $layout_info
|
||||
if($layout_info->extra_var_count) {
|
||||
foreach($layout_info->extra_var as $var_id => $val) {
|
||||
if($layout_info->extra_var_count)
|
||||
{
|
||||
foreach($layout_info->extra_var as $var_id => $val)
|
||||
{
|
||||
$layout_info->{$var_id} = $val->value;
|
||||
}
|
||||
}
|
||||
// menu in layout information becomes an argument for Context:: set
|
||||
if($layout_info->menu_count) {
|
||||
foreach($layout_info->menu as $menu_id => $menu) {
|
||||
if($layout_info->menu_count)
|
||||
{
|
||||
foreach($layout_info->menu as $menu_id => $menu)
|
||||
{
|
||||
if(file_exists($menu->php_file)) @include($menu->php_file);
|
||||
Context::set($menu_id, $menu);
|
||||
}
|
||||
|
|
@ -335,15 +350,17 @@
|
|||
* Modify admin layout of faceoff
|
||||
* @deprecated
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminLayoutModify(){
|
||||
*/
|
||||
function dispLayoutAdminLayoutModify()
|
||||
{
|
||||
// Get layout_srl
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$layout_srl = $current_module_info->layout_srl;
|
||||
// Remove the remaining tmp files because of temporarily saving
|
||||
// This part needs to be modified
|
||||
$delete_tmp = Context::get('delete_tmp');
|
||||
if($delete_tmp =='Y'){
|
||||
if($delete_tmp =='Y')
|
||||
{
|
||||
$oLayoutAdminController = &getAdminController('layout');
|
||||
$oLayoutAdminController->deleteUserLayoutTempFile($layout_srl);
|
||||
}
|
||||
|
|
@ -357,7 +374,8 @@
|
|||
$css = FileHandler::readFile($faceoffcss);
|
||||
$match = null;
|
||||
preg_match_all('/([^\{]+)\{([^\}]*)\}/is',$css,$match);
|
||||
for($i=0,$c=count($match[1]);$i<$c;$i++) {
|
||||
for($i=0,$c=count($match[1]);$i<$c;$i++)
|
||||
{
|
||||
$name = trim($match[1][$i]);
|
||||
$css = trim($match[2][$i]);
|
||||
if(!$css) continue;
|
||||
|
|
@ -365,7 +383,8 @@
|
|||
$style[] .= sprintf('"%s":"%s"',$name,$css);
|
||||
}
|
||||
|
||||
if(count($style)) {
|
||||
if(count($style))
|
||||
{
|
||||
$script = '<script type="text/javascript"> var faceOffStyle = {'.implode(',',$style).'}; </script>';
|
||||
Context::addHtmlHeader($script);
|
||||
}
|
||||
|
|
@ -383,7 +402,8 @@
|
|||
* Copy layout instance
|
||||
* @return void
|
||||
*/
|
||||
function dispLayoutAdminCopyLayout(){
|
||||
function dispLayoutAdminCopyLayout()
|
||||
{
|
||||
$layoutSrl = Context::get('layout_srl');
|
||||
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
|
@ -393,4 +413,5 @@
|
|||
$this->setTemplateFile('copy_layout');
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file layout.admin.view.php */
|
||||
/* Location: ./modules/layout/layout.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
* @class layout
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* high class of the layout module
|
||||
**/
|
||||
|
||||
class layout extends ModuleObject {
|
||||
|
||||
*/
|
||||
class layout extends ModuleObject
|
||||
{
|
||||
/**
|
||||
* Implement if additional tasks are necessary when installing
|
||||
* @return Object
|
||||
**/
|
||||
function moduleInstall() {
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
// Create a directory to be used in the layout
|
||||
FileHandler::makeDir('./files/cache/layout');
|
||||
|
||||
|
|
@ -21,14 +21,16 @@
|
|||
/**
|
||||
* a method to check if successfully installed
|
||||
* @return boolean
|
||||
**/
|
||||
function checkUpdate() {
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2009. 02. 11 Add site_srl to layout table
|
||||
if(!$oDB->isColumnExists('layouts', 'site_srl')) return true;
|
||||
// 2009. 02. 26 Move the previous layout for faceoff
|
||||
$files = FileHandler::readDir('./files/cache/layout');
|
||||
for($i=0,$c=count($files);$i<$c;$i++) {
|
||||
for($i=0,$c=count($files);$i<$c;$i++)
|
||||
{
|
||||
$filename = $files[$i];
|
||||
if(preg_match('/([0-9]+)\.html/i',$filename)) return true;
|
||||
}
|
||||
|
|
@ -53,17 +55,20 @@
|
|||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2009. 02. 11 Add site_srl to menu table
|
||||
if(!$oDB->isColumnExists('layouts', 'site_srl')) {
|
||||
if(!$oDB->isColumnExists('layouts', 'site_srl'))
|
||||
{
|
||||
$oDB->addColumn('layouts','site_srl','number',11,0,true);
|
||||
}
|
||||
// 2009. 02. 26 Move the previous layout for faceoff
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$files = FileHandler::readDir('./files/cache/layout');
|
||||
for($i=0,$c=count($files);$i<$c;$i++) {
|
||||
for($i=0,$c=count($files);$i<$c;$i++)
|
||||
{
|
||||
$filename = $files[$i];
|
||||
if(!preg_match('/([0-9]+)\.html/i',$filename,$match)) continue;
|
||||
$layout_srl = $match[1];
|
||||
|
|
@ -74,7 +79,8 @@
|
|||
@unlink('./files/cache/layout/'.$filename);
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists('layouts', 'layout_type')) {
|
||||
if(!$oDB->isColumnExists('layouts', 'layout_type'))
|
||||
{
|
||||
$oDB->addColumn('layouts','layout_type','char',1,'P',true);
|
||||
}
|
||||
|
||||
|
|
@ -97,17 +103,19 @@
|
|||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Re-generate the cache file
|
||||
* @return void
|
||||
**/
|
||||
function recompileCache() {
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
$path = './files/cache/layout';
|
||||
if(!is_dir($path)) {
|
||||
if(!is_dir($path))
|
||||
{
|
||||
FileHandler::makeDir($path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file layout.class.php */
|
||||
/* Location: ./modules/layout/layout.class.php */
|
||||
|
|
|
|||
|
|
@ -4,21 +4,21 @@
|
|||
* @author NHN (developers@xpressengine.com)
|
||||
* @version 0.1
|
||||
* Model class of the layout module
|
||||
**/
|
||||
|
||||
class layoutModel extends layout {
|
||||
|
||||
*/
|
||||
class layoutModel extends layout
|
||||
{
|
||||
/**
|
||||
* Check user layout temp
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $useUserLayoutTemp = null;
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -29,9 +29,11 @@
|
|||
* @param string $layout_type (P : PC, M : Mobile)
|
||||
* @param array $columnList
|
||||
* @return array layout lists in site
|
||||
**/
|
||||
function getLayoutList($site_srl = 0, $layout_type="P", $columnList = array()) {
|
||||
if(!$site_srl) {
|
||||
*/
|
||||
function getLayoutList($site_srl = 0, $layout_type="P", $columnList = array())
|
||||
{
|
||||
if(!$site_srl)
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
}
|
||||
|
|
@ -102,7 +104,7 @@
|
|||
* @param string $layout name of layout
|
||||
* @param array $columnList
|
||||
* @return array layout lists in site
|
||||
**/
|
||||
*/
|
||||
function getLayoutInstanceList($siteSrl = 0, $layoutType = 'P', $layout = null, $columnList = array())
|
||||
{
|
||||
if (!$siteSrl)
|
||||
|
|
@ -182,21 +184,23 @@
|
|||
return $output->data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get one of layout information created in the DB
|
||||
* Return DB info + XML info of the generated layout
|
||||
* @param int $layout_srl
|
||||
* @return object info of layout
|
||||
**/
|
||||
function getLayout($layout_srl) {
|
||||
*/
|
||||
function getLayout($layout_srl)
|
||||
{
|
||||
// cache controll
|
||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport()){
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$layout_srl;
|
||||
$layout_info = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
if(!$layout_info) {
|
||||
if(!$layout_info)
|
||||
{
|
||||
// Get information from the DB
|
||||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery('layout.getLayout', $args);
|
||||
|
|
@ -232,16 +236,24 @@
|
|||
* @param string $layout_name
|
||||
* @param string $layout_type (P : PC, M : Mobile)
|
||||
* @return string path of layout
|
||||
**/
|
||||
function getLayoutPath($layout_name, $layout_type = "P") {
|
||||
*/
|
||||
function getLayoutPath($layout_name, $layout_type = "P")
|
||||
{
|
||||
$layout_parse = explode('|@|', $layout_name);
|
||||
if (count($layout_parse) > 1){
|
||||
if(count($layout_parse) > 1)
|
||||
{
|
||||
$class_path = './themes/'.$layout_parse[0].'/layouts/'.$layout_parse[1].'/';
|
||||
}else if($layout_name == 'faceoff'){
|
||||
}
|
||||
else if($layout_name == 'faceoff')
|
||||
{
|
||||
$class_path = './modules/layout/faceoff/';
|
||||
}else if($layout_type == "M") {
|
||||
}
|
||||
else if($layout_type == "M")
|
||||
{
|
||||
$class_path = sprintf("./m.layouts/%s/", $layout_name);
|
||||
}else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$class_path = sprintf('./layouts/%s/', $layout_name);
|
||||
}
|
||||
if(is_dir($class_path)) return $class_path;
|
||||
|
|
@ -254,8 +266,9 @@
|
|||
* @param string $layout_type (P : PC, M : Mobile)
|
||||
* @param boolean $withAutoinstallInfo
|
||||
* @return array info of layout
|
||||
**/
|
||||
function getDownloadedLayoutList($layout_type = "P", $withAutoinstallInfo = false) {
|
||||
*/
|
||||
function getDownloadedLayoutList($layout_type = "P", $withAutoinstallInfo = false)
|
||||
{
|
||||
if ($withAutoinstallInfo) $oAutoinstallModel = &getModel('autoinstall');
|
||||
|
||||
// Get a list of downloaded layout and installed layout
|
||||
|
|
@ -266,7 +279,8 @@
|
|||
// natcasesort($searched_list);
|
||||
// Return information for looping searched list of layouts
|
||||
$list = array();
|
||||
for($i=0;$i<$searched_count;$i++) {
|
||||
for($i=0;$i<$searched_count;$i++)
|
||||
{
|
||||
// Name of the layout
|
||||
$layout = $searched_list[$i];
|
||||
// Get information of the layout
|
||||
|
|
@ -330,7 +344,7 @@
|
|||
* Get a count of layout
|
||||
* @param string $layoutType (P : PC, M : Mobile)
|
||||
* @return int
|
||||
**/
|
||||
*/
|
||||
function getInstalledLayoutCount($layoutType = 'P')
|
||||
{
|
||||
$searchedList = $this->_getInstalledLayoutDirectories($layoutType);
|
||||
|
|
@ -341,7 +355,7 @@
|
|||
* Get list of layouts directory
|
||||
* @param string $layoutType (P : PC, M : Mobile)
|
||||
* @return array
|
||||
**/
|
||||
*/
|
||||
function _getInstalledLayoutDirectories($layoutType = 'P')
|
||||
{
|
||||
if($layoutType == 'M')
|
||||
|
|
@ -371,16 +385,19 @@
|
|||
* @param object $info
|
||||
* @param string $layoutType (P : PC, M : Mobile)
|
||||
* @return object info of layout
|
||||
**/
|
||||
function getLayoutInfo($layout, $info = null, $layout_type = "P") {
|
||||
if($info) {
|
||||
*/
|
||||
function getLayoutInfo($layout, $info = null, $layout_type = "P")
|
||||
{
|
||||
if($info)
|
||||
{
|
||||
$layout_title = $info->title;
|
||||
$layout = $info->layout;
|
||||
$layout_srl = $info->layout_srl;
|
||||
$site_srl = $info->site_srl;
|
||||
$vars = unserialize($info->extra_vars);
|
||||
|
||||
if($info->module_srl) {
|
||||
if($info->module_srl)
|
||||
{
|
||||
$layout_path = preg_replace('/([a-zA-Z0-9\_\.]+)(\.html)$/','',$info->layout_path);
|
||||
$xml_file = sprintf('%sskin.xml', $layout_path);
|
||||
}
|
||||
|
|
@ -390,7 +407,8 @@
|
|||
if(!is_dir($layout_path)) return;
|
||||
// Read the xml file for module skin information
|
||||
if(!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path);
|
||||
if(!file_exists($xml_file)) {
|
||||
if(!file_exists($xml_file))
|
||||
{
|
||||
$layout_info->title = $layout;
|
||||
$layout_info->layout = $layout;
|
||||
$layout_info->path = $layout_path;
|
||||
|
|
@ -400,18 +418,24 @@
|
|||
return $layout_info;
|
||||
}
|
||||
// Include the cache file if it is valid and then return $layout_info variable
|
||||
if(!$layout_srl){
|
||||
if(!$layout_srl)
|
||||
{
|
||||
$cache_file = $this->getLayoutCache($layout, Context::getLangType());
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
$cache_file = $this->getUserLayoutCache($layout_srl, Context::getLangType());
|
||||
}
|
||||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file)) {
|
||||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
|
||||
{
|
||||
@include($cache_file);
|
||||
|
||||
|
||||
if($layout_info->extra_var && $vars) {
|
||||
foreach($vars as $key => $value) {
|
||||
if(!$layout_info->extra_var->{$key} && !$layout_info->{$key}) {
|
||||
if($layout_info->extra_var && $vars)
|
||||
{
|
||||
foreach($vars as $key => $value)
|
||||
{
|
||||
if(!$layout_info->extra_var->{$key} && !$layout_info->{$key})
|
||||
{
|
||||
$layout_info->{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
|
@ -435,7 +459,8 @@
|
|||
$buff = '';
|
||||
$buff .= sprintf('$layout_info->site_srl = "%s";', $site_srl);
|
||||
|
||||
if($xml_obj->version && $xml_obj->attrs->version == '0.2') {
|
||||
if($xml_obj->version && $xml_obj->attrs->version == '0.2')
|
||||
{
|
||||
// Layout title, version and other information
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
|
|
@ -456,7 +481,8 @@
|
|||
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
|
||||
else $author_list = $xml_obj->author;
|
||||
|
||||
for($i=0; $i < count($author_list); $i++) {
|
||||
for($i=0; $i < count($author_list); $i++)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
|
||||
$buff .= sprintf('$layout_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
|
||||
$buff .= sprintf('$layout_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
|
||||
|
|
@ -465,15 +491,18 @@
|
|||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
foreach($extra_var_groups as $group){
|
||||
foreach($extra_var_groups as $group)
|
||||
{
|
||||
$extra_vars = $group->var;
|
||||
if($extra_vars) {
|
||||
if($extra_vars)
|
||||
{
|
||||
if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
|
||||
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++) {
|
||||
for($i=0;$i<$extra_var_count;$i++)
|
||||
{
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
|
|
@ -491,32 +520,37 @@
|
|||
if(!is_array($options)) $options = array($options);
|
||||
$options_count = count($options);
|
||||
$thumbnail_exist = false;
|
||||
for($j=0; $j < $options_count; $j++) {
|
||||
for($j=0; $j < $options_count; $j++)
|
||||
{
|
||||
$thumbnail = $options[$j]->attrs->src;
|
||||
if($thumbnail) {
|
||||
if($thumbnail)
|
||||
{
|
||||
$thumbnail = $layout_path.$thumbnail;
|
||||
if(file_exists($thumbnail)) {
|
||||
if(file_exists($thumbnail))
|
||||
{
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"]->thumbnail = "%s";', $var->attrs->name, $options[$j]->attrs->value, $thumbnail);
|
||||
if(!$thumbnail_exist) {
|
||||
if(!$thumbnail_exist)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->thumbnail_exist = true;', $var->attrs->name);
|
||||
$thumbnail_exist = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"]->val = "%s";', $var->attrs->name, $options[$j]->attrs->value, $options[$j]->title->body);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Menu
|
||||
if($xml_obj->menus->menu) {
|
||||
if($xml_obj->menus->menu)
|
||||
{
|
||||
$menus = $xml_obj->menus->menu;
|
||||
if(!is_array($menus)) $menus = array($menus);
|
||||
|
||||
$menu_count = count($menus);
|
||||
$buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
|
||||
for($i=0;$i<$menu_count;$i++) {
|
||||
for($i=0;$i<$menu_count;$i++)
|
||||
{
|
||||
$name = $menus[$i]->attrs->name;
|
||||
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
|
||||
|
|
@ -529,43 +563,47 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// history
|
||||
if($xml_obj->history) {
|
||||
if($xml_obj->history)
|
||||
{
|
||||
if(!is_array($xml_obj->history)) $history_list[] = $xml_obj->history;
|
||||
else $history_list = $xml_obj->history;
|
||||
|
||||
for($i=0; $i < count($history_list); $i++) {
|
||||
for($i=0; $i < count($history_list); $i++)
|
||||
{
|
||||
sscanf($history_list[$i]->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->date = "%s";', $date);
|
||||
|
||||
if($history_list[$i]->author) {
|
||||
if($history_list[$i]->author)
|
||||
{
|
||||
(!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author;
|
||||
|
||||
for($j=0; $j < count($obj->author_list); $j++) {
|
||||
for($j=0; $j < count($obj->author_list); $j++)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
|
||||
if($history_list[$i]->log) {
|
||||
if($history_list[$i]->log)
|
||||
{
|
||||
(!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log;
|
||||
|
||||
for($j=0; $j < count($obj->log_list); $j++) {
|
||||
for($j=0; $j < count($obj->log_list); $j++)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Layout title, version and other information
|
||||
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
|
|
@ -585,15 +623,18 @@
|
|||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
foreach($extra_var_groups as $group){
|
||||
foreach($extra_var_groups as $group)
|
||||
{
|
||||
$extra_vars = $group->var;
|
||||
if($extra_vars) {
|
||||
if($extra_vars)
|
||||
{
|
||||
if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
|
||||
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++) {
|
||||
for($i=0;$i<$extra_var_count;$i++)
|
||||
{
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
|
|
@ -610,32 +651,33 @@
|
|||
|
||||
if(!is_array($options)) $options = array($options);
|
||||
$options_count = count($options);
|
||||
for($j=0;$j<$options_count;$j++) {
|
||||
for($j=0;$j<$options_count;$j++)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"]->val = "%s";', $var->attrs->name, $options[$j]->value->body, $options[$j]->title->body);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Menu
|
||||
if($xml_obj->menus->menu) {
|
||||
if($xml_obj->menus->menu)
|
||||
{
|
||||
$menus = $xml_obj->menus->menu;
|
||||
if(!is_array($menus)) $menus = array($menus);
|
||||
|
||||
$menu_count = count($menus);
|
||||
$buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
|
||||
for($i=0;$i<$menu_count;$i++) {
|
||||
for($i=0;$i<$menu_count;$i++)
|
||||
{
|
||||
$name = $menus[$i]->attrs->name;
|
||||
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
|
||||
$buff .= sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->maxdepth->body);
|
||||
|
||||
$buff .= sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// header_script
|
||||
|
|
@ -664,8 +706,9 @@
|
|||
* Return a list of images which are uploaded on the layout setting page
|
||||
* @param int $layout_srl
|
||||
* @return array image list in layout
|
||||
**/
|
||||
function getUserLayoutImageList($layout_srl){
|
||||
*/
|
||||
function getUserLayoutImageList($layout_srl)
|
||||
{
|
||||
$path = $this->getUserLayoutImagePath($layout_srl);
|
||||
$list = FileHandler::readDir($path);
|
||||
return $list;
|
||||
|
|
@ -676,10 +719,12 @@
|
|||
* @param int $layout_srl
|
||||
* @param string $layout_name
|
||||
* @return array
|
||||
**/
|
||||
function getUserLayoutIniConfig($layout_srl, $layout_name=null){
|
||||
*/
|
||||
function getUserLayoutIniConfig($layout_srl, $layout_name=null)
|
||||
{
|
||||
$file = $this->getUserLayoutIni($layout_srl);
|
||||
if($layout_name && !file_exists(FileHandler::getRealPath($file))){
|
||||
if($layout_name && !file_exists(FileHandler::getRealPath($file)))
|
||||
{
|
||||
FileHandler::copyFile($this->getDefaultLayoutIni($layout_name),$this->getUserLayoutIni($layout_srl));
|
||||
}
|
||||
|
||||
|
|
@ -691,8 +736,9 @@
|
|||
* get user layout path
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutPath($layout_srl){
|
||||
*/
|
||||
function getUserLayoutPath($layout_srl)
|
||||
{
|
||||
return sprintf("./files/faceOff/%s",getNumberingPath($layout_srl,3));
|
||||
}
|
||||
|
||||
|
|
@ -700,8 +746,9 @@
|
|||
* get user layout image path
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutImagePath($layout_srl){
|
||||
*/
|
||||
function getUserLayoutImagePath($layout_srl)
|
||||
{
|
||||
return $this->getUserLayoutPath($layout_srl). 'images/';
|
||||
}
|
||||
|
||||
|
|
@ -709,8 +756,9 @@
|
|||
* css which is set by an administrator on the layout setting page
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutCss($layout_srl){
|
||||
*/
|
||||
function getUserLayoutCss($layout_srl)
|
||||
{
|
||||
return $this->getUserLayoutPath($layout_srl). 'layout.css';
|
||||
}
|
||||
|
||||
|
|
@ -718,8 +766,9 @@
|
|||
* Import faceoff css from css module handler
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutFaceOffCss($layout_srl){
|
||||
*/
|
||||
function getUserLayoutFaceOffCss($layout_srl)
|
||||
{
|
||||
$src = $this->_getUserLayoutFaceOffCss($layout_srl);
|
||||
if($this->useUserLayoutTemp == 'temp') return;
|
||||
return $src;
|
||||
|
|
@ -729,8 +778,9 @@
|
|||
* Import faceoff css from css module handler
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function _getUserLayoutFaceOffCss($layout_srl){
|
||||
*/
|
||||
function _getUserLayoutFaceOffCss($layout_srl)
|
||||
{
|
||||
return $this->getUserLayoutPath($layout_srl). 'faceoff.css';
|
||||
}
|
||||
|
||||
|
|
@ -738,8 +788,9 @@
|
|||
* get user layout tmp html
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutTempFaceOffCss($layout_srl){
|
||||
*/
|
||||
function getUserLayoutTempFaceOffCss($layout_srl)
|
||||
{
|
||||
return $this->getUserLayoutPath($layout_srl). 'tmp.faceoff.css';
|
||||
}
|
||||
|
||||
|
|
@ -747,14 +798,18 @@
|
|||
* user layout html
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutHtml($layout_srl){
|
||||
*/
|
||||
function getUserLayoutHtml($layout_srl)
|
||||
{
|
||||
$src = $this->getUserLayoutPath($layout_srl). 'layout.html';
|
||||
$temp = $this->getUserLayoutTempHtml($layout_srl);
|
||||
if($this->useUserLayoutTemp == 'temp'){
|
||||
if($this->useUserLayoutTemp == 'temp')
|
||||
{
|
||||
if(!file_exists(FileHandler::getRealPath($temp))) FileHandler::copyFile($src,$temp);
|
||||
return $temp;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
return $src;
|
||||
}
|
||||
}
|
||||
|
|
@ -763,8 +818,9 @@
|
|||
* user layout tmp html
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutTempHtml($layout_srl){
|
||||
*/
|
||||
function getUserLayoutTempHtml($layout_srl)
|
||||
{
|
||||
return $this->getUserLayoutPath($layout_srl). 'tmp.layout.html';
|
||||
}
|
||||
|
||||
|
|
@ -772,14 +828,18 @@
|
|||
* user layout ini
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutIni($layout_srl){
|
||||
*/
|
||||
function getUserLayoutIni($layout_srl)
|
||||
{
|
||||
$src = $this->getUserLayoutPath($layout_srl). 'layout.ini';
|
||||
$temp = $this->getUserLayoutTempIni($layout_srl);
|
||||
if($this->useUserLayoutTemp == 'temp'){
|
||||
if($this->useUserLayoutTemp == 'temp')
|
||||
{
|
||||
if(!file_exists(FileHandler::getRealPath($temp))) FileHandler::copyFile($src,$temp);
|
||||
return $temp;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
return $src;
|
||||
}
|
||||
}
|
||||
|
|
@ -788,8 +848,9 @@
|
|||
* user layout tmp ini
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutTempIni($layout_srl){
|
||||
*/
|
||||
function getUserLayoutTempIni($layout_srl)
|
||||
{
|
||||
return $this->getUserLayoutPath($layout_srl). 'tmp.layout.ini';
|
||||
}
|
||||
|
||||
|
|
@ -799,8 +860,9 @@
|
|||
* @param int $layout_srl
|
||||
* @param string $lang_type
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutCache($layout_srl,$lang_type){
|
||||
*/
|
||||
function getUserLayoutCache($layout_srl,$lang_type)
|
||||
{
|
||||
return $this->getUserLayoutPath($layout_srl). "{$lang_type}.cache.php";
|
||||
}
|
||||
|
||||
|
|
@ -809,8 +871,9 @@
|
|||
* @param int $layout_srl
|
||||
* @param string $lang_type
|
||||
* @return string
|
||||
**/
|
||||
function getLayoutCache($layout_name,$lang_type){
|
||||
*/
|
||||
function getLayoutCache($layout_name,$lang_type)
|
||||
{
|
||||
return sprintf("./files/cache/layout/%s.%s.cache.php",$layout_name,$lang_type);
|
||||
}
|
||||
|
||||
|
|
@ -818,8 +881,9 @@
|
|||
* default layout ini to prevent arbitrary changes by a user
|
||||
* @param string $layout_name
|
||||
* @return string
|
||||
**/
|
||||
function getDefaultLayoutIni($layout_name){
|
||||
*/
|
||||
function getDefaultLayoutIni($layout_name)
|
||||
{
|
||||
return $this->getDefaultLayoutPath($layout_name). 'layout.ini';
|
||||
}
|
||||
|
||||
|
|
@ -827,8 +891,9 @@
|
|||
* default layout html to prevent arbitrary changes by a user
|
||||
* @param string $layout_name
|
||||
* @return string
|
||||
**/
|
||||
function getDefaultLayoutHtml($layout_name){
|
||||
*/
|
||||
function getDefaultLayoutHtml($layout_name)
|
||||
{
|
||||
return $this->getDefaultLayoutPath($layout_name). 'layout.html';
|
||||
}
|
||||
|
||||
|
|
@ -836,8 +901,9 @@
|
|||
* default layout css to prevent arbitrary changes by a user
|
||||
* @param string $layout_name
|
||||
* @return string
|
||||
**/
|
||||
function getDefaultLayoutCss($layout_name){
|
||||
*/
|
||||
function getDefaultLayoutCss($layout_name)
|
||||
{
|
||||
return $this->getDefaultLayoutPath($layout_name). 'css/layout.css';
|
||||
}
|
||||
|
||||
|
|
@ -845,8 +911,9 @@
|
|||
* default layout path to prevent arbitrary changes by a user
|
||||
* @deprecated
|
||||
* @return string
|
||||
**/
|
||||
function getDefaultLayoutPath() {
|
||||
*/
|
||||
function getDefaultLayoutPath()
|
||||
{
|
||||
return "./modules/layout/faceoff/";
|
||||
}
|
||||
|
||||
|
|
@ -854,8 +921,9 @@
|
|||
* faceoff is
|
||||
* @param string $layout_name
|
||||
* @return boolean (true : faceoff, false : layout)
|
||||
**/
|
||||
function useDefaultLayout($layout_name){
|
||||
*/
|
||||
function useDefaultLayout($layout_name)
|
||||
{
|
||||
$info = $this->getLayoutInfo($layout_name);
|
||||
if($info->type == 'faceoff') return true;
|
||||
else return false;
|
||||
|
|
@ -865,8 +933,9 @@
|
|||
* Set user layout as temporary save mode
|
||||
* @param string $flag (default 'temp')
|
||||
* @return void
|
||||
**/
|
||||
function setUseUserLayoutTemp($flag='temp'){
|
||||
*/
|
||||
function setUseUserLayoutTemp($flag='temp')
|
||||
{
|
||||
$this->useUserLayoutTemp = $flag;
|
||||
}
|
||||
|
||||
|
|
@ -874,8 +943,9 @@
|
|||
* Temp file list for User Layout
|
||||
* @param int $layout_srl
|
||||
* @return array temp files info
|
||||
**/
|
||||
function getUserLayoutTempFileList($layout_srl){
|
||||
*/
|
||||
function getUserLayoutTempFileList($layout_srl)
|
||||
{
|
||||
$file_list = array(
|
||||
$this->getUserLayoutTempHtml($layout_srl)
|
||||
,$this->getUserLayoutTempFaceOffCss($layout_srl)
|
||||
|
|
@ -888,13 +958,14 @@
|
|||
* Saved file list for User Layout
|
||||
* @param int $layout_srl
|
||||
* @return array files info
|
||||
**/
|
||||
function getUserLayoutFileList($layout_srl){
|
||||
*/
|
||||
function getUserLayoutFileList($layout_srl)
|
||||
{
|
||||
$file_list = array(
|
||||
basename($this->getUserLayoutHtml($layout_srl))
|
||||
,basename($this->getUserLayoutFaceOffCss($layout_srl))
|
||||
,basename($this->getUserLayoutIni($layout_srl))
|
||||
,basename($this->getUserLayoutCss($layout_srl))
|
||||
basename($this->getUserLayoutHtml($layout_srl)),
|
||||
basename($this->getUserLayoutFaceOffCss($layout_srl)),
|
||||
basename($this->getUserLayoutIni($layout_srl)),
|
||||
basename($this->getUserLayoutCss($layout_srl))
|
||||
);
|
||||
|
||||
$image_path = $this->getUserLayoutImagePath($layout_srl);
|
||||
|
|
@ -909,8 +980,9 @@
|
|||
* @deprecated
|
||||
* @param object $layout_info
|
||||
* @return void
|
||||
**/
|
||||
function doActivateFaceOff(&$layout_info) {
|
||||
*/
|
||||
function doActivateFaceOff(&$layout_info)
|
||||
{
|
||||
$layout_info->faceoff_ini_config = $this->getUserLayoutIniConfig($layout_info->layout_srl, $layout_info->layout);
|
||||
// faceoff layout CSS
|
||||
Context::addCSSFile($this->getDefaultLayoutCss($layout_info->layout));
|
||||
|
|
@ -924,14 +996,17 @@
|
|||
// Different page displayed upon user's permission
|
||||
$logged_info = Context::get('logged_info');
|
||||
// Display edit button for faceoff layout
|
||||
if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')===false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) {
|
||||
if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')===false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin))
|
||||
{
|
||||
Context::addHtmlFooter('<div class="faceOffManager" style="height: 23px; position: fixed; right: 3px; top: 3px;"><a href="'.getUrl('','mid',Context::get('mid'),'act','dispLayoutAdminLayoutModify','delete_tmp','Y').'">'.Context::getLang('cmd_layout_edit').'</a></div>');
|
||||
}
|
||||
// Display menu when editing the faceOff page
|
||||
if(Context::get('act')=='dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) {
|
||||
if(Context::get('act')=='dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin))
|
||||
{
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
Context::addBodyHeader($oTemplate->compile($this->module_path.'/tpl', 'faceoff_layout_menu'));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file layout.model.php */
|
||||
/* Location: ./modules/layout/layout.model.php */
|
||||
|
|
|
|||
|
|
@ -3,23 +3,24 @@
|
|||
* @class layoutView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* admin view class of the layout module
|
||||
**/
|
||||
|
||||
class layoutView extends layout {
|
||||
|
||||
*/
|
||||
class layoutView extends layout
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* Pop-up layout details(conf/info.xml)
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutInfo() {
|
||||
*/
|
||||
function dispLayoutInfo()
|
||||
{
|
||||
// Get the layout information
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout'));
|
||||
|
|
@ -35,7 +36,7 @@
|
|||
* Preview a layout with module.
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
*/
|
||||
public function dispLayoutPreviewWithModule()
|
||||
{
|
||||
// admin check
|
||||
|
|
@ -204,7 +205,7 @@
|
|||
/**
|
||||
* Preview a layout
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
*/
|
||||
function dispLayoutPreview()
|
||||
{
|
||||
// admin check
|
||||
|
|
@ -226,14 +227,18 @@
|
|||
// Apply CSS directly
|
||||
Context::addHtmlHeader("<style type=\"text/css\" charset=\"UTF-8\">".$code_css."</style>");
|
||||
// Set names and values of extra_vars to $layout_info
|
||||
if($layout_info->extra_var_count) {
|
||||
foreach($layout_info->extra_var as $var_id => $val) {
|
||||
if($layout_info->extra_var_count)
|
||||
{
|
||||
foreach($layout_info->extra_var as $var_id => $val)
|
||||
{
|
||||
$layout_info->{$var_id} = $val->value;
|
||||
}
|
||||
}
|
||||
// menu in layout information becomes an argument for Context:: set
|
||||
if($layout_info->menu_count) {
|
||||
foreach($layout_info->menu as $menu_id => $menu) {
|
||||
if($layout_info->menu_count)
|
||||
{
|
||||
foreach($layout_info->menu as $menu_id => $menu)
|
||||
{
|
||||
if(file_exists($menu->php_file)) @include($menu->php_file);
|
||||
Context::set($menu_id, $menu);
|
||||
}
|
||||
|
|
@ -262,4 +267,5 @@
|
|||
}
|
||||
|
||||
}
|
||||
?>
|
||||
/* End of file layout.view.php */
|
||||
/* Location: ./modules/layout/layout.view.php */
|
||||
|
|
|
|||
|
|
@ -3,36 +3,41 @@
|
|||
* @class memberAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* member module of the admin controller class
|
||||
**/
|
||||
|
||||
class memberAdminController extends member {
|
||||
|
||||
*/
|
||||
class memberAdminController extends member
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a user (Administrator)
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procMemberAdminInsert() {
|
||||
*/
|
||||
function procMemberAdminInsert()
|
||||
{
|
||||
// if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
|
||||
// Extract the necessary information in advance
|
||||
$args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date');
|
||||
$oMemberModel = &getModel ('member');
|
||||
$config = $oMemberModel->getMemberConfig ();
|
||||
$getVars = array();
|
||||
if ($config->signupForm){
|
||||
foreach($config->signupForm as $formInfo) {
|
||||
if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)){
|
||||
if($config->signupForm)
|
||||
{
|
||||
foreach($config->signupForm as $formInfo)
|
||||
{
|
||||
if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
|
||||
{
|
||||
$getVars[] = $formInfo->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach($getVars as $val){
|
||||
foreach($getVars as $val)
|
||||
{
|
||||
$args->{$val} = Context::get($val);
|
||||
}
|
||||
$args->member_srl = Context::get('member_srl');
|
||||
|
|
@ -53,7 +58,8 @@
|
|||
$extra_vars = delObjectVars($all_args, $args);
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
// Check if an original member exists having the member_srl
|
||||
if($args->member_srl) {
|
||||
if($args->member_srl)
|
||||
{
|
||||
// Create a member model object
|
||||
$oMemberModel = &getModel('member');
|
||||
// Get memebr profile
|
||||
|
|
@ -66,19 +72,24 @@
|
|||
// remove whitespace
|
||||
$checkInfos = array('user_id', 'nick_name', 'email_address');
|
||||
$replaceStr = array("\r\n", "\r", "\n", " ", "\t", "\xC2\xAD");
|
||||
foreach($checkInfos as $val){
|
||||
if(isset($args->{$val})){
|
||||
foreach($checkInfos as $val)
|
||||
{
|
||||
if(isset($args->{$val}))
|
||||
{
|
||||
$args->{$val} = str_replace($replaceStr, '', $args->{$val});
|
||||
}
|
||||
}
|
||||
|
||||
$oMemberController = &getController('member');
|
||||
// Execute insert or update depending on the value of member_srl
|
||||
if(!$args->member_srl) {
|
||||
if(!$args->member_srl)
|
||||
{
|
||||
$args->password = Context::get('password');
|
||||
$output = $oMemberController->insertMember($args);
|
||||
$msg_code = 'success_registed';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = $oMemberController->updateMember($args);
|
||||
$msg_code = 'success_updated';
|
||||
}
|
||||
|
|
@ -92,17 +103,20 @@
|
|||
$this->setMessage($msg_code);
|
||||
|
||||
$profile_image = $_FILES['profile_image'];
|
||||
if (is_uploaded_file($profile_image['tmp_name'])){
|
||||
if(is_uploaded_file($profile_image['tmp_name']))
|
||||
{
|
||||
$oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
|
||||
}
|
||||
|
||||
$image_mark = $_FILES['image_mark'];
|
||||
if (is_uploaded_file($image_mark['tmp_name'])){
|
||||
if(is_uploaded_file($image_mark['tmp_name']))
|
||||
{
|
||||
$oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']);
|
||||
}
|
||||
|
||||
$image_name = $_FILES['image_name'];
|
||||
if (is_uploaded_file($image_name['tmp_name'])){
|
||||
if (is_uploaded_file($image_name['tmp_name']))
|
||||
{
|
||||
$oMemberController->insertImageName($args->member_srl, $image_name['tmp_name']);
|
||||
}
|
||||
|
||||
|
|
@ -113,8 +127,9 @@
|
|||
/**
|
||||
* Delete a user (Administrator)
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procMemberAdminDelete() {
|
||||
*/
|
||||
function procMemberAdminDelete()
|
||||
{
|
||||
// Separate all the values into DB entries and others
|
||||
$member_srl = Context::get('member_srl');
|
||||
|
||||
|
|
@ -153,9 +168,6 @@
|
|||
$args = Context::gets(
|
||||
'enable_confirm',
|
||||
'limit_day',
|
||||
|
||||
|
||||
|
||||
'agreement',
|
||||
'redirect_url',
|
||||
'profile_image', 'profile_image_max_width', 'profile_image_max_height',
|
||||
|
|
@ -190,16 +202,6 @@
|
|||
$args->signature = $args->signature != 'Y' ? 'N' : 'Y';
|
||||
$args->identifier = $all_args->identifier;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// set default
|
||||
$all_args->is_nick_name_public = 'Y';
|
||||
$all_args->is_find_account_question_public = 'N';
|
||||
|
|
@ -223,16 +225,9 @@
|
|||
$signupItem->imageType = (strpos($key, 'image') !== false);
|
||||
$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
|
||||
$signupItem->isUse = in_array($key, $usable_list) || $signupItem->required;
|
||||
|
||||
$signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($signupItem->imageType){
|
||||
if($signupItem->imageType)
|
||||
{
|
||||
$signupItem->max_width = $all_args->{$key.'_max_width'};
|
||||
$signupItem->max_height = $all_args->{$key.'_max_height'};
|
||||
}
|
||||
|
|
@ -246,18 +241,9 @@
|
|||
$signupItem->title = $extendItem->column_title;
|
||||
$signupItem->description = $extendItem->description;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// check usable value change, required/option
|
||||
if ($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y')){
|
||||
if($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
|
||||
{
|
||||
unset($update_args);
|
||||
$update_args->member_join_form_srl = $extendItem->member_join_form_srl;
|
||||
$update_args->is_active = $signupItem->isUse?'Y':'N';
|
||||
|
|
@ -266,26 +252,7 @@
|
|||
$update_output = executeQuery('member.updateJoinForm', $update_args);
|
||||
}
|
||||
|
||||
|
||||
unset($extendItem);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
$signupForm[] = $signupItem;
|
||||
}
|
||||
|
|
@ -400,7 +367,8 @@
|
|||
$orgUse = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday');
|
||||
$list_order = array();
|
||||
|
||||
foreach($items as $key){
|
||||
foreach($items as $key)
|
||||
{
|
||||
unset($signupItem);
|
||||
$signupItem->isDefaultForm = true;
|
||||
$signupItem->name = $key;
|
||||
|
|
@ -424,8 +392,10 @@
|
|||
else
|
||||
$list_order[] = $signupItem;
|
||||
}
|
||||
if (is_array($extendItems)){
|
||||
foreach($extendItems as $form_srl=>$item_info){
|
||||
if(is_array($extendItems))
|
||||
{
|
||||
foreach($extendItems as $form_srl=>$item_info)
|
||||
{
|
||||
unset($signupItem);
|
||||
$signupItem->name = $item_info->column_name;
|
||||
$signupItem->title = $item_info->column_title;
|
||||
|
|
@ -436,7 +406,8 @@
|
|||
$signupItem->isUse = ($item_info->is_active == 'Y');
|
||||
$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
|
||||
$signupItem->description = $item_info->description;
|
||||
if ($signupItem->imageType){
|
||||
if($signupItem->imageType)
|
||||
{
|
||||
$signupItem->max_width = $config->{$key.'_max_width'};
|
||||
$signupItem->max_height = $config->{$key.'_max_height'};
|
||||
}
|
||||
|
|
@ -452,40 +423,58 @@
|
|||
* @param object $signupForm (user define signup form)
|
||||
* @param string $agreement
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function _createSignupRuleset($signupForm, $agreement = null){
|
||||
$xml_file = './files/ruleset/insertMember.xml';
|
||||
$buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL
|
||||
.'<ruleset version="1.5.0">' . PHP_EOL
|
||||
.'<customrules>' . PHP_EOL
|
||||
.'</customrules>' . PHP_EOL
|
||||
.'<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL
|
||||
.'</ruleset>';
|
||||
$buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL.
|
||||
'<ruleset version="1.5.0">' . PHP_EOL.
|
||||
'<customrules>' . PHP_EOL.
|
||||
'</customrules>' . PHP_EOL.
|
||||
'<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL.
|
||||
'</ruleset>';
|
||||
|
||||
$fields = array();
|
||||
|
||||
if ($agreement){
|
||||
if ($agreement)
|
||||
{
|
||||
$fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>';
|
||||
}
|
||||
foreach($signupForm as $formInfo){
|
||||
if ($formInfo->required || $formInfo->mustRequired){
|
||||
if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip'){
|
||||
foreach($signupForm as $formInfo)
|
||||
{
|
||||
if($formInfo->required || $formInfo->mustRequired)
|
||||
{
|
||||
if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
|
||||
{
|
||||
$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
|
||||
}else if($formInfo->name == 'password'){
|
||||
}
|
||||
else if($formInfo->name == 'password')
|
||||
{
|
||||
$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="3:20" /></field>';
|
||||
$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
|
||||
}else if($formInfo->name == 'find_account_question'){
|
||||
}
|
||||
else if($formInfo->name == 'find_account_question')
|
||||
{
|
||||
$fields[] = '<field name="find_account_question" required="true" />';
|
||||
$fields[] = '<field name="find_account_answer" required="true" length=":250" />';
|
||||
}else if($formInfo->name == 'email_address'){
|
||||
}
|
||||
else if($formInfo->name == 'email_address')
|
||||
{
|
||||
$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
|
||||
}else if($formInfo->name == 'user_id'){
|
||||
}
|
||||
else if($formInfo->name == 'user_id')
|
||||
{
|
||||
$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
|
||||
}else if(strpos($formInfo->name, 'image') !== false){
|
||||
}
|
||||
else if(strpos($formInfo->name, 'image') !== false)
|
||||
{
|
||||
$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' && $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
|
||||
}else if($formInfo->name == 'signature'){
|
||||
}
|
||||
else if($formInfo->name == 'signature')
|
||||
{
|
||||
$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
$fields[] = sprintf('<field name="%s" required="true" />', $formInfo->name);
|
||||
}
|
||||
}
|
||||
|
|
@ -504,15 +493,16 @@
|
|||
* Create ruleset file of login
|
||||
* @param string $identifier (login identifier)
|
||||
* @return void
|
||||
**/
|
||||
function _createLoginRuleset($identifier){
|
||||
*/
|
||||
function _createLoginRuleset($identifier)
|
||||
{
|
||||
$xml_file = './files/ruleset/login.xml';
|
||||
$buff = '<?xml version="1.0" encoding="utf-8"?>'
|
||||
.'<ruleset version="1.5.0">'
|
||||
.'<customrules>'
|
||||
.'</customrules>'
|
||||
.'<fields>%s</fields>'
|
||||
.'</ruleset>';
|
||||
$buff = '<?xml version="1.0" encoding="utf-8"?>'.
|
||||
'<ruleset version="1.5.0">'.
|
||||
'<customrules>'.
|
||||
'</customrules>'.
|
||||
'<fields>%s</fields>'.
|
||||
'</ruleset>';
|
||||
|
||||
$fields = array();
|
||||
$trans = array('email_address'=>'email', 'user_id'=> 'userid');
|
||||
|
|
@ -531,15 +521,16 @@
|
|||
* Create ruleset file of find account
|
||||
* @param string $identifier (login identifier)
|
||||
* @return void
|
||||
**/
|
||||
function _createFindAccountByQuestion($identifier){
|
||||
*/
|
||||
function _createFindAccountByQuestion($identifier)
|
||||
{
|
||||
$xml_file = './files/ruleset/find_member_account_by_question.xml';
|
||||
$buff = '<?xml version="1.0" encoding="utf-8"?>'
|
||||
.'<ruleset version="1.5.0">'
|
||||
.'<customrules>'
|
||||
.'</customrules>'
|
||||
.'<fields>%s</fields>'
|
||||
.'</ruleset>';
|
||||
$buff = '<?xml version="1.0" encoding="utf-8"?>'.
|
||||
'<ruleset version="1.5.0">'.
|
||||
'<customrules>'.
|
||||
'</customrules>'.
|
||||
'<fields>%s</fields>'.
|
||||
'</ruleset>';
|
||||
|
||||
$fields = array();
|
||||
if($identifier == 'user_id')
|
||||
|
|
@ -560,8 +551,9 @@
|
|||
/**
|
||||
* Add a user group
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procMemberAdminInsertGroup() {
|
||||
*/
|
||||
function procMemberAdminInsertGroup()
|
||||
{
|
||||
$args = Context::gets('title','description','is_default','image_mark');
|
||||
$output = $this->insertGroup($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -577,8 +569,9 @@
|
|||
/**
|
||||
* Update user group information
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procMemberAdminUpdateGroup() {
|
||||
*/
|
||||
function procMemberAdminUpdateGroup()
|
||||
{
|
||||
$group_srl = Context::get('group_srl');
|
||||
|
||||
$args = Context::gets('group_srl','title','description','is_default','image_mark');
|
||||
|
|
@ -597,8 +590,9 @@
|
|||
/**
|
||||
* Update user group information
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procMemberAdminDeleteGroup() {
|
||||
*/
|
||||
function procMemberAdminDeleteGroup()
|
||||
{
|
||||
$group_srl = Context::get('group_srl');
|
||||
|
||||
$output = $this->deleteGroup($group_srl);
|
||||
|
|
@ -615,7 +609,7 @@
|
|||
/**
|
||||
* Add a join form
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
*/
|
||||
function procMemberAdminInsertJoinForm()
|
||||
{
|
||||
$args->member_join_form_srl = Context::get('member_join_form_srl');
|
||||
|
|
@ -629,18 +623,24 @@
|
|||
if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
|
||||
$args->description = Context::get('description') ? Context::get('description') : '';
|
||||
// Default values
|
||||
if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value) ) {
|
||||
if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
|
||||
{
|
||||
$args->default_value = serialize($args->default_value);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->default_value = '';
|
||||
}
|
||||
// Fix if member_join_form_srl exists. Add if not exists.
|
||||
$isInsert;
|
||||
if(!$args->member_join_form_srl){
|
||||
if(!$args->member_join_form_srl)
|
||||
{
|
||||
$isInsert = true;
|
||||
$args->list_order = $args->member_join_form_srl = getNextSequence();
|
||||
$output = executeQuery('member.insertJoinForm', $args);
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = executeQuery('member.updateJoinForm', $args);
|
||||
}
|
||||
|
||||
|
|
@ -660,11 +660,16 @@
|
|||
$config = $oMemberModel->getMemberConfig();
|
||||
unset($config->agreement);
|
||||
|
||||
if($isInsert){
|
||||
if($isInsert)
|
||||
{
|
||||
$config->signupForm[] = $signupItem;
|
||||
}else{
|
||||
foreach($config->signupForm as $key=>$val){
|
||||
if ($val->member_join_form_srl == $signupItem->member_join_form_srl){
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($config->signupForm as $key=>$val)
|
||||
{
|
||||
if($val->member_join_form_srl == $signupItem->member_join_form_srl)
|
||||
{
|
||||
$config->signupForm[$key] = $signupItem;
|
||||
}
|
||||
}
|
||||
|
|
@ -681,8 +686,9 @@
|
|||
/**
|
||||
* Delete a join form
|
||||
* @return void
|
||||
**/
|
||||
function procMemberAdminDeleteJoinForm(){
|
||||
*/
|
||||
function procMemberAdminDeleteJoinForm()
|
||||
{
|
||||
$member_join_form_srl = Context::get('member_join_form_srl');
|
||||
$this->deleteJoinForm($member_join_form_srl);
|
||||
|
||||
|
|
@ -690,8 +696,10 @@
|
|||
$config = $oMemberModel->getMemberConfig();
|
||||
unset($config->agreement);
|
||||
|
||||
foreach($config->signupForm as $key=>$val){
|
||||
if ($val->member_join_form_srl == $member_join_form_srl){
|
||||
foreach($config->signupForm as $key=>$val)
|
||||
{
|
||||
if($val->member_join_form_srl == $member_join_form_srl)
|
||||
{
|
||||
unset($config->signupForm[$key]);
|
||||
break;
|
||||
}
|
||||
|
|
@ -704,12 +712,14 @@
|
|||
* Move up/down the member join form and modify it
|
||||
* @deprecated
|
||||
* @return void
|
||||
**/
|
||||
function procMemberAdminUpdateJoinForm() {
|
||||
*/
|
||||
function procMemberAdminUpdateJoinForm()
|
||||
{
|
||||
$member_join_form_srl = Context::get('member_join_form_srl');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
switch($mode) {
|
||||
switch($mode)
|
||||
{
|
||||
case 'up' :
|
||||
$output = $this->moveJoinFormUp($member_join_form_srl);
|
||||
$msg_code = 'success_moved';
|
||||
|
|
@ -733,8 +743,9 @@
|
|||
/**
|
||||
* selected member manager layer in dispAdminList
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procMemberAdminSelectedMemberManage(){
|
||||
*/
|
||||
function procMemberAdminSelectedMemberManage()
|
||||
{
|
||||
$var = Context::getRequestVars();
|
||||
$groups = $var->groups;
|
||||
$members = $var->member_srls;
|
||||
|
|
@ -743,42 +754,53 @@
|
|||
$oDB->begin();
|
||||
|
||||
$oMemberController = &getController('member');
|
||||
foreach($members as $key=>$member_srl){
|
||||
foreach($members as $key=>$member_srl)
|
||||
{
|
||||
unset($args);
|
||||
$args->member_srl = $member_srl;
|
||||
switch($var->type){
|
||||
case 'modify':{
|
||||
if (count($groups) > 0){
|
||||
switch($var->type)
|
||||
{
|
||||
case 'modify':
|
||||
{
|
||||
if(count($groups) > 0)
|
||||
{
|
||||
$args->site_srl = 0;
|
||||
// One of its members to delete all the group
|
||||
$output = executeQuery('member.deleteMemberGroupMember', $args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
// Enter one of the loop a
|
||||
foreach($groups as $group_srl) {
|
||||
foreach($groups as $group_srl)
|
||||
{
|
||||
$output = $oMemberController->addMemberToGroup($args->member_srl,$group_srl);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($var->denied){
|
||||
if($var->denied)
|
||||
{
|
||||
$args->denied = $var->denied;
|
||||
$output = executeQuery('member.updateMemberDeniedInfo', $args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'delete':{
|
||||
case 'delete':
|
||||
{
|
||||
$oMemberController->memberInfo = null;
|
||||
$output = $oMemberController->deleteMember($member_srl);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -788,14 +810,16 @@
|
|||
|
||||
$message = $var->message;
|
||||
// Send a message
|
||||
if($message) {
|
||||
if($message)
|
||||
{
|
||||
$oCommunicationController = &getController('communication');
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$title = cut_str($message,10,'...');
|
||||
$sender_member_srl = $logged_info->member_srl;
|
||||
|
||||
foreach($members as $member_srl){
|
||||
foreach($members as $member_srl)
|
||||
{
|
||||
$oCommunicationController->sendMessage($sender_member_srl, $member_srl, $title, $message, false);
|
||||
}
|
||||
}
|
||||
|
|
@ -808,15 +832,18 @@
|
|||
* Delete the selected members
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
*/
|
||||
function procMemberAdminDeleteMembers() {
|
||||
function procMemberAdminDeleteMembers()
|
||||
{
|
||||
$target_member_srls = Context::get('target_member_srls');
|
||||
if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
|
||||
$member_srls = explode(',', $target_member_srls);
|
||||
$oMemberController = &getController('member');
|
||||
|
||||
foreach($member_srls as $member) {
|
||||
foreach($member_srls as $member)
|
||||
{
|
||||
$output = $oMemberController->deleteMember($member);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$this->setMessage('failed_deleted');
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -828,8 +855,9 @@
|
|||
/**
|
||||
* Update a group of selected memebrs
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procMemberAdminUpdateMembersGroup() {
|
||||
*/
|
||||
function procMemberAdminUpdateMembersGroup()
|
||||
{
|
||||
$member_srl = Context::get('member_srl');
|
||||
if(!$member_srl) return new Object(-1,'msg_invalid_request');
|
||||
$member_srls = explode(',',$member_srl);
|
||||
|
|
@ -843,17 +871,20 @@
|
|||
// Delete a group of selected members
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('member.deleteMembersGroup', $args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
// Add to a selected group
|
||||
$group_count = count($group_srls);
|
||||
$member_count = count($member_srls);
|
||||
for($j=0;$j<$group_count;$j++) {
|
||||
for($j=0;$j<$group_count;$j++)
|
||||
{
|
||||
$group_srl = (int)trim($group_srls[$j]);
|
||||
if(!$group_srl) continue;
|
||||
for($i=0;$i<$member_count;$i++) {
|
||||
for($i=0;$i<$member_count;$i++)
|
||||
{
|
||||
$member_srl = (int)trim($member_srls[$i]);
|
||||
if(!$member_srl) continue;
|
||||
|
||||
|
|
@ -862,7 +893,8 @@
|
|||
$args->group_srl = $group_srl;
|
||||
|
||||
$output = executeQuery('member.addMemberToGroup', $args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -871,7 +903,8 @@
|
|||
$oDB->commit();
|
||||
$this->setMessage('success_updated');
|
||||
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
|
||||
{
|
||||
global $lang;
|
||||
htmlHeader();
|
||||
alertScript($lang->success_updated);
|
||||
|
|
@ -886,14 +919,16 @@
|
|||
/**
|
||||
* Add a denied ID
|
||||
* @return void
|
||||
**/
|
||||
function procMemberAdminInsertDeniedID() {
|
||||
*/
|
||||
function procMemberAdminInsertDeniedID()
|
||||
{
|
||||
$user_ids = Context::get('user_id');
|
||||
|
||||
$user_ids = explode(',',$user_ids);
|
||||
$success_ids = array();
|
||||
|
||||
foreach($user_ids as $val){
|
||||
foreach($user_ids as $val)
|
||||
{
|
||||
$output = $this->insertDeniedID($val, '');
|
||||
if($output->toBool()) $success_ids[] = $val;
|
||||
}
|
||||
|
|
@ -907,7 +942,7 @@
|
|||
/**
|
||||
* Add a denied nick name
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function procMemberAdminUpdateDeniedNickName()
|
||||
{
|
||||
$nick_name = Context::get('nick_name');
|
||||
|
|
@ -943,12 +978,14 @@
|
|||
/**
|
||||
* Update denied ID
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procMemberAdminUpdateDeniedID() {
|
||||
*/
|
||||
function procMemberAdminUpdateDeniedID()
|
||||
{
|
||||
$user_id = Context::get('user_id');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
switch($mode) {
|
||||
switch($mode)
|
||||
{
|
||||
case 'delete' :
|
||||
$output = $this->deleteDeniedID($user_id);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -964,8 +1001,9 @@
|
|||
* Add an administrator
|
||||
* @param object $args
|
||||
* @return object (info of added member)
|
||||
**/
|
||||
function insertAdmin($args) {
|
||||
*/
|
||||
function insertAdmin($args)
|
||||
{
|
||||
// Assign an administrator
|
||||
$args->is_admin = 'Y';
|
||||
// Get admin group and set
|
||||
|
|
@ -982,8 +1020,9 @@
|
|||
* @param int $source_group_srl
|
||||
* @param int $target_group_srl
|
||||
* @return Object
|
||||
**/
|
||||
function changeGroup($source_group_srl, $target_group_srl) {
|
||||
*/
|
||||
function changeGroup($source_group_srl, $target_group_srl)
|
||||
{
|
||||
$args->source_group_srl = $source_group_srl;
|
||||
$args->target_group_srl = $target_group_srl;
|
||||
|
||||
|
|
@ -994,13 +1033,17 @@
|
|||
* find_account_answerInsert a group
|
||||
* @param object $args
|
||||
* @return Object
|
||||
**/
|
||||
function insertGroup($args) {
|
||||
*/
|
||||
function insertGroup($args)
|
||||
{
|
||||
if(!$args->site_srl) $args->site_srl = 0;
|
||||
// Check the value of is_default.
|
||||
if($args->is_default!='Y') {
|
||||
if($args->is_default!='Y')
|
||||
{
|
||||
$args->is_default = 'N';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = executeQuery('member.updateGroupDefaultClear', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
|
@ -1013,13 +1056,17 @@
|
|||
* Modify Group Information
|
||||
* @param object $args
|
||||
* @return Object
|
||||
**/
|
||||
function updateGroup($args) {
|
||||
*/
|
||||
function updateGroup($args)
|
||||
{
|
||||
// Check the value of is_default.
|
||||
if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
|
||||
if($args->is_default!='Y') {
|
||||
if($args->is_default!='Y')
|
||||
{
|
||||
$args->is_default = 'N';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = executeQuery('member.updateGroupDefaultClear', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
|
@ -1032,8 +1079,9 @@
|
|||
* @param int $group_srl
|
||||
* @param int $site_srl
|
||||
* @return Object
|
||||
**/
|
||||
function deleteGroup($group_srl, $site_srl = 0) {
|
||||
*/
|
||||
function deleteGroup($group_srl, $site_srl = 0)
|
||||
{
|
||||
// Create a member model object
|
||||
$oMemberModel = &getModel('member');
|
||||
// Check the group_srl (If is_default == 'Y', it cannot be deleted)
|
||||
|
|
@ -1056,8 +1104,9 @@
|
|||
/**
|
||||
* Set group config
|
||||
* @return void
|
||||
**/
|
||||
function procMemberAdminGroupConfig() {
|
||||
*/
|
||||
function procMemberAdminGroupConfig()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
if(is_array($vars->group_titles))
|
||||
|
|
@ -1082,7 +1131,8 @@
|
|||
|
||||
// group data save
|
||||
$group_srls = $vars->group_srls;
|
||||
foreach($group_srls as $order=>$group_srl){
|
||||
foreach($group_srls as $order=>$group_srl)
|
||||
{
|
||||
unset($update_args);
|
||||
$update_args->title = $vars->group_titles[$order];
|
||||
$update_args->is_default = ($vars->defaultGroup == $group_srl)?'Y':'N';
|
||||
|
|
@ -1090,10 +1140,12 @@
|
|||
$update_args->image_mark = $vars->image_marks[$order];
|
||||
$update_args->list_order = $order + 1;
|
||||
|
||||
if (is_numeric($group_srl)){
|
||||
if(is_numeric($group_srl))
|
||||
{
|
||||
$update_args->group_srl = $group_srl;
|
||||
$output = $this->updateGroup($update_args);
|
||||
}else
|
||||
}
|
||||
else
|
||||
$output = $this->insertGroup($update_args);
|
||||
}
|
||||
|
||||
|
|
@ -1106,11 +1158,13 @@
|
|||
/**
|
||||
* Set group order
|
||||
* @return void
|
||||
**/
|
||||
function procMemberAdminUpdateGroupOrder() {
|
||||
*/
|
||||
function procMemberAdminUpdateGroupOrder()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
foreach($vars->group_srls as $key => $val){
|
||||
foreach($vars->group_srls as $key => $val)
|
||||
{
|
||||
$args->group_srl = $val;
|
||||
$args->list_order = $key + 1;
|
||||
executeQuery('member.updateMemberGroupListOrder', $args);
|
||||
|
|
@ -1124,8 +1178,9 @@
|
|||
* @param string $user_id
|
||||
* @param string $description
|
||||
* @return Object
|
||||
**/
|
||||
function insertDeniedID($user_id, $description = '') {
|
||||
*/
|
||||
function insertDeniedID($user_id, $description = '')
|
||||
{
|
||||
$args->user_id = $user_id;
|
||||
$args->description = $description;
|
||||
$args->list_order = -1*getNextSequence();
|
||||
|
|
@ -1145,8 +1200,9 @@
|
|||
* delete a denied id
|
||||
* @param string $user_id
|
||||
* @return object
|
||||
**/
|
||||
function deleteDeniedID($user_id) {
|
||||
*/
|
||||
function deleteDeniedID($user_id)
|
||||
{
|
||||
$args->user_id = $user_id;
|
||||
return executeQuery('member.deleteDeniedID', $args);
|
||||
}
|
||||
|
|
@ -1155,7 +1211,7 @@
|
|||
* delete a denied nick name
|
||||
* @param string $nick_name
|
||||
* @return object
|
||||
**/
|
||||
*/
|
||||
function deleteDeniedNickName($nick_name)
|
||||
{
|
||||
$args->nick_name = $nick_name;
|
||||
|
|
@ -1166,8 +1222,9 @@
|
|||
* Delete a join form
|
||||
* @param int $member_join_form_srl
|
||||
* @return Object
|
||||
**/
|
||||
function deleteJoinForm($member_join_form_srl) {
|
||||
*/
|
||||
function deleteJoinForm($member_join_form_srl)
|
||||
{
|
||||
$args->member_join_form_srl = $member_join_form_srl;
|
||||
$output = executeQuery('member.deleteJoinForm', $args);
|
||||
return $output;
|
||||
|
|
@ -1178,8 +1235,9 @@
|
|||
* @deprecated
|
||||
* @param int $member_join_form_srl
|
||||
* @return Object
|
||||
**/
|
||||
function moveJoinFormUp($member_join_form_srl) {
|
||||
*/
|
||||
function moveJoinFormUp($member_join_form_srl)
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
// Get information of the join form
|
||||
$args->member_join_form_srl = $member_join_form_srl;
|
||||
|
|
@ -1193,7 +1251,8 @@
|
|||
if(count($join_form_srl_list)<2) return new Object();
|
||||
|
||||
$prev_member_join_form = NULL;
|
||||
foreach($join_form_list as $key => $val) {
|
||||
foreach($join_form_list as $key => $val)
|
||||
{
|
||||
if($val->member_join_form_srl == $member_join_form_srl) break;
|
||||
$prev_member_join_form = $val;
|
||||
}
|
||||
|
|
@ -1220,8 +1279,9 @@
|
|||
* @deprecated
|
||||
* @param int $member_join_form_srl
|
||||
* @return Object
|
||||
**/
|
||||
function moveJoinFormDown($member_join_form_srl) {
|
||||
*/
|
||||
function moveJoinFormDown($member_join_form_srl)
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
// Get information of the join form
|
||||
$args->member_join_form_srl = $member_join_form_srl;
|
||||
|
|
@ -1234,7 +1294,8 @@
|
|||
$join_form_srl_list = array_keys($join_form_list);
|
||||
if(count($join_form_srl_list)<2) return new Object();
|
||||
|
||||
for($i=0;$i<count($join_form_srl_list);$i++) {
|
||||
for($i=0;$i<count($join_form_srl_list);$i++)
|
||||
{
|
||||
if($join_form_srl_list[$i]==$member_join_form_srl) break;
|
||||
}
|
||||
|
||||
|
|
@ -1258,4 +1319,5 @@
|
|||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file member.admin.controller.php */
|
||||
/* Location: ./modules/member/member.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -3,48 +3,50 @@
|
|||
* @class memberAdminModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* admin model class of member module
|
||||
**/
|
||||
|
||||
class memberAdminModel extends member {
|
||||
|
||||
*/
|
||||
class memberAdminModel extends member
|
||||
{
|
||||
/**
|
||||
* info of member
|
||||
* @var object
|
||||
**/
|
||||
*/
|
||||
var $member_info = NULL;
|
||||
|
||||
/**
|
||||
* info of member groups
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $member_groups = NULL;
|
||||
|
||||
/**
|
||||
* info of sign up form
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $join_form_list = NULL;
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a member list
|
||||
*
|
||||
* @return object|array (object : when member count is 1, array : when member count is more than 1)
|
||||
**/
|
||||
function getMemberList() {
|
||||
*/
|
||||
function getMemberList()
|
||||
{
|
||||
// Search option
|
||||
$args->is_admin = Context::get('is_admin')=='Y'?'Y':'';
|
||||
$args->is_denied = Context::get('is_denied')=='Y'?'Y':'';
|
||||
$args->selected_group_srl = Context::get('selected_group_srl');
|
||||
|
||||
$filter = Context::get('filter_type');
|
||||
switch($filter){
|
||||
switch($filter)
|
||||
{
|
||||
case 'super_admin' : $args->is_admin = 'Y';break;
|
||||
case 'site_admin' : $args->member_srls = $this->getSiteAdminMemberSrls();break;
|
||||
case 'enable' : $args->is_denied = 'N';break;
|
||||
|
|
@ -54,8 +56,10 @@
|
|||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
if($search_target && $search_keyword)
|
||||
{
|
||||
switch($search_target)
|
||||
{
|
||||
case 'user_id' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_id = $search_keyword;
|
||||
|
|
@ -100,11 +104,13 @@
|
|||
// Change the query id if selected_group_srl exists (for table join)
|
||||
$sort_order = Context::get('sort_order');
|
||||
$sort_index = Context::get('sort_index');
|
||||
if(!$sort_index) {
|
||||
if(!$sort_index)
|
||||
{
|
||||
$sort_index = "list_order";
|
||||
}
|
||||
|
||||
if(!$sort_order) {
|
||||
if(!$sort_order)
|
||||
{
|
||||
$sort_order = 'asc';
|
||||
}
|
||||
|
||||
|
|
@ -113,10 +119,13 @@
|
|||
$sort_order = 'desc';
|
||||
}
|
||||
|
||||
if($args->selected_group_srl) {
|
||||
if($args->selected_group_srl)
|
||||
{
|
||||
$query_id = 'member.getMemberListWithinGroup';
|
||||
$args->sort_index = "member.".$sort_index;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$query_id = 'member.getMemberList';
|
||||
$args->sort_index = $sort_index;
|
||||
}
|
||||
|
|
@ -139,8 +148,9 @@
|
|||
* @param int $page
|
||||
*
|
||||
* @return array
|
||||
**/
|
||||
function getSiteMemberList($site_srl, $page = 1) {
|
||||
*/
|
||||
function getSiteMemberList($site_srl, $page = 1)
|
||||
{
|
||||
$args->site_srl = $site_srl;
|
||||
$args->page = $page;
|
||||
$args->list_count = 40;
|
||||
|
|
@ -154,13 +164,15 @@
|
|||
* Get member_srls lists about site admins
|
||||
*
|
||||
* @return array
|
||||
**/
|
||||
function getSiteAdminMemberSrls(){
|
||||
*/
|
||||
function getSiteAdminMemberSrls()
|
||||
{
|
||||
$output = executeQueryArray('member.getSiteAdminMemberSrls');
|
||||
if(!$output->toBool() || !$output->data) return array();
|
||||
|
||||
$member_srls = array();
|
||||
foreach($output->data as $member_info){
|
||||
foreach($output->data as $member_info)
|
||||
{
|
||||
$member_srls[] = $member_info->member_srl;
|
||||
}
|
||||
|
||||
|
|
@ -171,11 +183,13 @@
|
|||
* Return colorset list of a skin in the member module
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function getMemberAdminColorset() {
|
||||
*/
|
||||
function getMemberAdminColorset()
|
||||
{
|
||||
$skin = Context::get('skin');
|
||||
if(!$skin) $tpl = "";
|
||||
else {
|
||||
else
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
|
||||
Context::set('skin_info', $skin_info);
|
||||
|
|
@ -198,8 +212,9 @@
|
|||
* @param string $date
|
||||
*
|
||||
* @return int
|
||||
**/
|
||||
function getMemberCountByDate($date = '') {
|
||||
*/
|
||||
function getMemberCountByDate($date = '')
|
||||
{
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
|
||||
$output = executeQuery('member.getMemberCountByDate', $args);
|
||||
|
|
@ -214,8 +229,9 @@
|
|||
* @param string $date
|
||||
*
|
||||
* @return int
|
||||
**/
|
||||
function getMemberGroupMemberCountByDate($date = '') {
|
||||
*/
|
||||
function getMemberGroupMemberCountByDate($date = '')
|
||||
{
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
|
||||
$output = executeQuery('member.getMemberGroupMemberCountByDate', $args);
|
||||
|
|
@ -228,17 +244,20 @@
|
|||
* Return add join Form
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function getMemberAdminInsertJoinForm() {
|
||||
*/
|
||||
function getMemberAdminInsertJoinForm()
|
||||
{
|
||||
$member_join_form_srl = Context::get('member_join_form_srl');
|
||||
|
||||
$args->member_join_form_srl = $member_join_form_srl;
|
||||
$output = executeQuery('member.getJoinForm', $args);
|
||||
|
||||
if($output->toBool() && $output->data){
|
||||
if($output->toBool() && $output->data)
|
||||
{
|
||||
$formInfo = $output->data;
|
||||
$default_value = $formInfo->default_value;
|
||||
if ($default_value){
|
||||
if($default_value)
|
||||
{
|
||||
$default_value = unserialize($default_value);
|
||||
Context::set('default_value', $default_value);
|
||||
}
|
||||
|
|
@ -251,22 +270,23 @@
|
|||
$this->add('tpl', str_replace("\n"," ",$tpl));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check allowed target ip address when login for admin.
|
||||
*
|
||||
* @return boolean (true : allowed, false : refuse)
|
||||
**/
|
||||
function getMemberAdminIPCheck() {
|
||||
|
||||
*/
|
||||
function getMemberAdminIPCheck()
|
||||
{
|
||||
$db_info = Context::getDBInfo();
|
||||
$admin_ip_list = $db_info->admin_ip_list;
|
||||
$admin_ip_list = explode(",",$admin_ip_list);
|
||||
$oMemberModel = &getModel('member');
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$falg = false;
|
||||
foreach($admin_ip_list as $admin_ip_list_key => $admin_ip_value) {
|
||||
if(preg_match('/^\d{1,3}(?:.(\d{1,3}|\*)){3}\s*$/', $admin_ip_value, $matches) && $ip) {
|
||||
foreach($admin_ip_list as $admin_ip_list_key => $admin_ip_value)
|
||||
{
|
||||
if(preg_match('/^\d{1,3}(?:.(\d{1,3}|\*)){3}\s*$/', $admin_ip_value, $matches) && $ip)
|
||||
{
|
||||
$admin_ip = $matches[0];
|
||||
$admin_ip = str_replace('*','',$admin_ip);
|
||||
$admin_ip_patterns[] = preg_quote($admin_ip);
|
||||
|
|
@ -274,10 +294,10 @@
|
|||
if(preg_match($admin_ip_pattern, $ip, $matches)) return true;
|
||||
$flag = true;
|
||||
}
|
||||
|
||||
}
|
||||
if(!$flag) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file member.admin.model.php */
|
||||
/* Location: ./modules/member/member.admin.model.php */
|
||||
|
|
|
|||
|
|
@ -3,36 +3,35 @@
|
|||
* @class memberAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* member module's admin view class
|
||||
**/
|
||||
|
||||
class memberAdminView extends member {
|
||||
|
||||
*/
|
||||
class memberAdminView extends member
|
||||
{
|
||||
/**
|
||||
* Group list
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $group_list = NULL;
|
||||
|
||||
/**
|
||||
* Selected member info
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $memberInfo = NULL;
|
||||
|
||||
/**
|
||||
* Member module config.
|
||||
*
|
||||
* @var Object
|
||||
**/
|
||||
*/
|
||||
var $memberConfig = NULL;
|
||||
|
||||
/**
|
||||
* initialization
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
|
|
@ -68,15 +67,17 @@
|
|||
* display member list
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function dispMemberAdminList() {
|
||||
*/
|
||||
function dispMemberAdminList()
|
||||
{
|
||||
$oMemberAdminModel = &getAdminModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
$output = $oMemberAdminModel->getMemberList();
|
||||
|
||||
$filter = Context::get('filter_type');
|
||||
global $lang;
|
||||
switch($filter){
|
||||
switch($filter)
|
||||
{
|
||||
case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member);break;
|
||||
case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member);break;
|
||||
case 'enable' : Context::set('filter_type_title', $lang->approval);break;
|
||||
|
|
@ -84,7 +85,8 @@
|
|||
default : Context::set('filter_type_title', $lang->cmd_show_all_member);break;
|
||||
}
|
||||
// retrieve list of groups for each member
|
||||
if($output->data) {
|
||||
if($output->data)
|
||||
{
|
||||
foreach($output->data as $key => $member)
|
||||
{
|
||||
$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl,0);
|
||||
|
|
@ -94,10 +96,13 @@
|
|||
$memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
|
||||
$usedIdentifiers = array();
|
||||
|
||||
if (is_array($config->signupForm)){
|
||||
foreach($config->signupForm as $signupItem){
|
||||
if(is_array($config->signupForm))
|
||||
{
|
||||
foreach($config->signupForm as $signupItem)
|
||||
{
|
||||
if(!count($memberIdentifiers)) break;
|
||||
if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse)){
|
||||
if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
|
||||
{
|
||||
unset($memberIdentifiers[$signupItem->name]);
|
||||
$usedIdentifiers[$signupItem->name] = $lang->{$signupItem->name};
|
||||
}
|
||||
|
|
@ -205,7 +210,7 @@
|
|||
* default configuration for member management
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function dispMemberAdminConfigOLD()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
|
|
@ -277,8 +282,9 @@
|
|||
* display member information
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function dispMemberAdminInfo() {
|
||||
*/
|
||||
function dispMemberAdminInfo()
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
|
|
@ -308,8 +314,9 @@
|
|||
* display member insert form
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function dispMemberAdminInsert() {
|
||||
*/
|
||||
function dispMemberAdminInsert()
|
||||
{
|
||||
// retrieve extend form
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
|
|
@ -318,7 +325,8 @@
|
|||
Context::set('member_info', $memberInfo);
|
||||
|
||||
// get an editor for the signature
|
||||
if($memberInfo->member_srl) {
|
||||
if($memberInfo->member_srl)
|
||||
{
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->primary_key_name = 'member_srl';
|
||||
$option->content_key_name = 'signature';
|
||||
|
|
@ -355,8 +363,9 @@
|
|||
* @param boolean $isAdmin (true : admin, false : not admin)
|
||||
*
|
||||
* @return array
|
||||
**/
|
||||
function _getMemberInputTag($memberInfo, $isAdmin = false){
|
||||
*/
|
||||
function _getMemberInputTag($memberInfo, $isAdmin = false)
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
$extend_form_list = $oMemberModel->getCombineJoinForm($memberInfo);
|
||||
|
||||
|
|
@ -374,7 +383,8 @@
|
|||
$formTags = array();
|
||||
global $lang;
|
||||
|
||||
foreach($member_config->signupForm as $no=>$formInfo){
|
||||
foreach($member_config->signupForm as $no=>$formInfo)
|
||||
{
|
||||
if(!$formInfo->isUse)continue;
|
||||
if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
|
||||
unset($formTag);
|
||||
|
|
@ -390,131 +400,172 @@
|
|||
}
|
||||
$formTag->name = $formInfo->name;
|
||||
|
||||
if($formInfo->isDefaultForm){
|
||||
if($formInfo->imageType){
|
||||
if($formInfo->isDefaultForm)
|
||||
{
|
||||
if($formInfo->imageType)
|
||||
{
|
||||
$formTag->type = 'image';
|
||||
if($formInfo->name == 'profile_image'){
|
||||
if($formInfo->name == 'profile_image')
|
||||
{
|
||||
$target = $memberInfo['profile_image'];
|
||||
$functionName = 'doDeleteProfileImage';
|
||||
}elseif($formInfo->name == 'image_name'){
|
||||
}
|
||||
else if($formInfo->name == 'image_name')
|
||||
{
|
||||
$target = $memberInfo['image_name'];
|
||||
$functionName = 'doDeleteImageName';
|
||||
}elseif($formInfo->name == 'image_mark'){
|
||||
}
|
||||
else if($formInfo->name == 'image_mark')
|
||||
{
|
||||
$target = $memberInfo['image_mark'];
|
||||
$functionName = 'doDeleteImageMark';
|
||||
}
|
||||
if($target->src){
|
||||
$inputTag = sprintf('<p class="a"><input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" class="text" onclick="%s(%d);return false;">%s</button></span></p>'
|
||||
,$formInfo->name
|
||||
,$formInfo->name.'tag'
|
||||
,$target->src
|
||||
,$formInfo->title
|
||||
,$functionName
|
||||
,$memberInfo['member_srl']
|
||||
,$lang->cmd_delete);
|
||||
}else{
|
||||
|
||||
if($target->src)
|
||||
{
|
||||
$inputTag = sprintf('<p class="a"><input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" class="text" onclick="%s(%d);return false;">%s</button></span></p>',
|
||||
$formInfo->name,
|
||||
$formInfo->name.'tag',
|
||||
$target->src,
|
||||
$formInfo->title,
|
||||
$functionName,
|
||||
$memberInfo['member_srl'],
|
||||
$lang->cmd_delete);
|
||||
}
|
||||
else
|
||||
{
|
||||
$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
|
||||
}
|
||||
$inputTag .= sprintf('<p class="a"><input type="file" name="%s" id="%s" value="" /></p><p><span class="desc">%s : %dpx, %s : %dpx</span></p>'
|
||||
,$formInfo->name
|
||||
,$formInfo->name
|
||||
,$lang->{$formInfo->name.'_max_width'}
|
||||
,$member_config->{$formInfo->name.'_max_width'}
|
||||
,$lang->{$formInfo->name.'_max_height'}
|
||||
,$member_config->{$formInfo->name.'_max_height'});
|
||||
$inputTag .= sprintf('<p class="a"><input type="file" name="%s" id="%s" value="" /></p><p><span class="desc">%s : %dpx, %s : %dpx</span></p>',
|
||||
$formInfo->name,
|
||||
$formInfo->name,
|
||||
$lang->{$formInfo->name.'_max_width'},
|
||||
$member_config->{$formInfo->name.'_max_width'},
|
||||
$lang->{$formInfo->name.'_max_height'},
|
||||
$member_config->{$formInfo->name.'_max_height'});
|
||||
}//end imageType
|
||||
elseif($formInfo->name == 'birthday'){
|
||||
else if($formInfo->name == 'birthday')
|
||||
{
|
||||
$formTag->type = 'date';
|
||||
$inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="date" placeholder="YYYY-MM-DD" class="inputDate" id="birthday" value="%s" /> <input type="button" value="%s" class="x_btn dateRemover" />'
|
||||
,$memberInfo['birthday']
|
||||
,zdate($memberInfo['birthday'], 'Y-m-d', false)
|
||||
,$lang->cmd_delete);
|
||||
}elseif($formInfo->name == 'find_account_question'){
|
||||
$inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="date" placeholder="YYYY-MM-DD" class="inputDate" id="birthday" value="%s" /> <input type="button" value="%s" class="x_btn dateRemover" />',
|
||||
$memberInfo['birthday'],
|
||||
zdate($memberInfo['birthday'], 'Y-m-d', false),
|
||||
$lang->cmd_delete);
|
||||
}
|
||||
else if($formInfo->name == 'find_account_question')
|
||||
{
|
||||
$formTag->type = 'select';
|
||||
$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0">%s</select>';
|
||||
$optionTag = array();
|
||||
foreach($lang->find_account_question_items as $key=>$val){
|
||||
foreach($lang->find_account_question_items as $key=>$val)
|
||||
{
|
||||
if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
|
||||
else $selected = '';
|
||||
$optionTag[] = sprintf('<option value="%s" %s >%s</option>'
|
||||
,$key
|
||||
,$selected
|
||||
,$val);
|
||||
$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
|
||||
$key,
|
||||
$selected,
|
||||
$val);
|
||||
}
|
||||
$inputTag = sprintf($inputTag, implode('', $optionTag));
|
||||
$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="'.$memberInfo['find_account_answer'].'" />';
|
||||
}elseif($formInfo->name == 'homepage'){
|
||||
}
|
||||
else if($formInfo->name == 'homepage')
|
||||
{
|
||||
$formTag->type = 'url';
|
||||
$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
|
||||
}elseif($formInfo->name == 'blog'){
|
||||
}
|
||||
else if($formInfo->name == 'blog')
|
||||
{
|
||||
$formTag->type = 'url';
|
||||
$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
$formTag->type = 'text';
|
||||
$inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />'
|
||||
,$formInfo->name
|
||||
,$formInfo->name
|
||||
,$memberInfo[$formInfo->name]);
|
||||
$inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />',
|
||||
$formInfo->name,
|
||||
$formInfo->name,
|
||||
$memberInfo[$formInfo->name]);
|
||||
}
|
||||
}//end isDefaultForm
|
||||
else{
|
||||
else
|
||||
{
|
||||
$extendForm = $extend_form_list[$formInfo->member_join_form_srl];
|
||||
$replace = array('column_name' => $extendForm->column_name,
|
||||
'value' => $extendForm->value);
|
||||
$replace = array('column_name' => $extendForm->column_name, 'value' => $extendForm->value);
|
||||
$extentionReplace = array();
|
||||
|
||||
$formTag->type = $extendForm->column_type;
|
||||
if($extendForm->column_type == 'text'){
|
||||
if($extendForm->column_type == 'text')
|
||||
{
|
||||
$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
|
||||
}elseif($extendForm->column_type == 'homepage'){
|
||||
}
|
||||
else if($extendForm->column_type == 'homepage')
|
||||
{
|
||||
$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
|
||||
}elseif($extendForm->column_type == 'email_address'){
|
||||
}
|
||||
else if($extendForm->column_type == 'email_address')
|
||||
{
|
||||
$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
|
||||
}elseif($extendForm->column_type == 'tel'){
|
||||
}
|
||||
else if($extendForm->column_type == 'tel')
|
||||
{
|
||||
$extentionReplace = array('tel_0' => $extendForm->value[0],
|
||||
'tel_1' => $extendForm->value[1],
|
||||
'tel_2' => $extendForm->value[2]);
|
||||
$template = '<input type="text" name="%column_name%[]" value="%tel_0%" size="4" maxlength="4" style="width:30px" />-<input type="text" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:30px" />-<input type="text" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:30px" />';
|
||||
}elseif($extendForm->column_type == 'textarea'){
|
||||
}
|
||||
else if($extendForm->column_type == 'textarea')
|
||||
{
|
||||
$template = '<textarea name="%column_name%" rows="8" cols="42">%value%</textarea>';
|
||||
}elseif($extendForm->column_type == 'checkbox'){
|
||||
}
|
||||
else if($extendForm->column_type == 'checkbox')
|
||||
{
|
||||
$template = '';
|
||||
if($extendForm->default_value){
|
||||
if($extendForm->default_value)
|
||||
{
|
||||
$__i = 0;
|
||||
foreach($extendForm->default_value as $v){
|
||||
foreach($extendForm->default_value as $v)
|
||||
{
|
||||
$checked = '';
|
||||
if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
|
||||
$template .= '<input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.htmlspecialchars($v).'" '.$checked.' /><label for="%column_name%'.$__i.'">'.$v.'</label>';
|
||||
$__i++;
|
||||
}
|
||||
}
|
||||
}elseif($extendForm->column_type == 'radio'){
|
||||
}
|
||||
else if($extendForm->column_type == 'radio')
|
||||
{
|
||||
$template = '';
|
||||
if($extendForm->default_value){
|
||||
if($extendForm->default_value)
|
||||
{
|
||||
$template = '<ul class="radio">%s</ul>';
|
||||
$optionTag = array();
|
||||
foreach($extendForm->default_value as $v){
|
||||
foreach($extendForm->default_value as $v)
|
||||
{
|
||||
if($extendForm->value == $v)$checked = 'checked="checked"';
|
||||
else $checked = '';
|
||||
$optionTag[] = '<li><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' />'.$v.'</li>';
|
||||
}
|
||||
$template = sprintf($template, implode('', $optionTag));
|
||||
}
|
||||
}elseif($extendForm->column_type == 'select'){
|
||||
}
|
||||
else if($extendForm->column_type == 'select')
|
||||
{
|
||||
$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
|
||||
$optionTag = array();
|
||||
if($extendForm->default_value){
|
||||
foreach($extendForm->default_value as $v){
|
||||
if($extendForm->default_value)
|
||||
{
|
||||
foreach($extendForm->default_value as $v)
|
||||
{
|
||||
if($v == $extendForm->value) $selected = 'selected="selected"';
|
||||
else $selected = '';
|
||||
$optionTag[] = sprintf('<option value="%s" %s >%s</option>'
|
||||
,$v
|
||||
,$selected
|
||||
,$v);
|
||||
$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
|
||||
}
|
||||
}
|
||||
$template = sprintf($template, implode('', $optionTag));
|
||||
}elseif($extendForm->column_type == 'kr_zip'){
|
||||
}
|
||||
else if($extendForm->column_type == 'kr_zip')
|
||||
{
|
||||
Context::loadFile(array('./modules/member/tpl/js/krzip_search.js', 'body'), true);
|
||||
$extentionReplace = array(
|
||||
'msg_kr_address' => $lang->msg_kr_address,
|
||||
|
|
@ -542,11 +593,14 @@
|
|||
</div>
|
||||
<script>jQuery(function($){ $.krzip('%column_name%') });</script>
|
||||
EOD;
|
||||
}elseif($extendForm->column_type == 'jp_zip'){
|
||||
}
|
||||
else if($extendForm->column_type == 'jp_zip')
|
||||
{
|
||||
$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
|
||||
}elseif($extendForm->column_type == 'date'){
|
||||
$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'),
|
||||
'cmd_delete' => $lang->cmd_delete);
|
||||
}
|
||||
else if($extendForm->column_type == 'date')
|
||||
{
|
||||
$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
|
||||
$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="date" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="dateRemover" />';
|
||||
}
|
||||
|
||||
|
|
@ -566,7 +620,7 @@ EOD;
|
|||
* display group list
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function dispMemberAdminGroupList()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
|
|
@ -580,16 +634,18 @@ EOD;
|
|||
* Display an admin page for memebr join forms
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function dispMemberAdminInsertJoinForm() {
|
||||
// Get the value of join_form
|
||||
$member_join_form_srl = Context::get('member_join_form_srl');
|
||||
if($member_join_form_srl) {
|
||||
if($member_join_form_srl)
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
|
||||
|
||||
if(!$join_form) Context::set('member_join_form_srl','',true);
|
||||
else {
|
||||
else
|
||||
{
|
||||
Context::set('join_form', $join_form);
|
||||
$security = new Security();
|
||||
$security->encodeHTML('join_form..');
|
||||
|
|
@ -598,6 +654,6 @@ EOD;
|
|||
}
|
||||
$this->setTemplateFile('insert_join_form');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
/* End of file member.admin.view.php */
|
||||
/* Location: ./modules/member/member.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -3,18 +3,18 @@
|
|||
* @class memberAPI
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* API Processing of View Action in the member module
|
||||
**/
|
||||
|
||||
class memberAPI extends member {
|
||||
|
||||
*/
|
||||
class memberAPI extends member
|
||||
{
|
||||
/**
|
||||
* Content List
|
||||
*
|
||||
* @param Object $oModule
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function dispSavedDocumentList(&$oModule) {
|
||||
*/
|
||||
function dispSavedDocumentList(&$oModule)
|
||||
{
|
||||
$document_list = $this->arrangeContentList(Context::get('document_list'));
|
||||
$oModule->add('document_list',$document_list);
|
||||
$oModule->add('page_navigation',Context::get('page_navigation'));
|
||||
|
|
@ -26,10 +26,12 @@
|
|||
* @param array $content_list
|
||||
*
|
||||
* @return array
|
||||
**/
|
||||
function arrangeContentList($content_list) {
|
||||
*/
|
||||
function arrangeContentList($content_list)
|
||||
{
|
||||
$output = array();
|
||||
if(count($content_list)) {
|
||||
if(count($content_list))
|
||||
{
|
||||
foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
|
||||
}
|
||||
return $output;
|
||||
|
|
@ -41,13 +43,16 @@
|
|||
* @param array $content_list
|
||||
*
|
||||
* @return array
|
||||
**/
|
||||
function arrangeContent($content) {
|
||||
*/
|
||||
function arrangeContent($content)
|
||||
{
|
||||
$output = null;
|
||||
if($content){
|
||||
if($content)
|
||||
{
|
||||
$output= $content->gets('document_srl','category_srl','nick_name','user_id','user_name','title','content','tags','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file member.api.php */
|
||||
/* Location: ./modules/member/member.api.php */
|
||||
|
|
|
|||
|
|
@ -3,28 +3,29 @@
|
|||
* @class member
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* high class of the member module
|
||||
**/
|
||||
*/
|
||||
class member extends ModuleObject {
|
||||
|
||||
/**
|
||||
* Use sha1 encryption
|
||||
*
|
||||
* @var boolean
|
||||
**/
|
||||
*/
|
||||
var $useSha1 = false;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function member() {
|
||||
*/
|
||||
function member()
|
||||
{
|
||||
if(!Context::isInstalled()) return;
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$member_config = $oModuleModel->getModuleConfig('member');
|
||||
// Set to use SSL upon actions related member join/information/password and so on
|
||||
if(Context::get('_use_ssl') == 'optional') {
|
||||
if(Context::get('_use_ssl') == 'optional')
|
||||
{
|
||||
Context::addSSLAction('dispMemberModifyPassword');
|
||||
Context::addSSLAction('dispMemberSignUpForm');
|
||||
Context::addSSLAction('dispMemberModifyInfo');
|
||||
|
|
@ -51,8 +52,9 @@
|
|||
* Implement if additional tasks are necessary when installing
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function moduleInstall() {
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
// Register action forward (to use in administrator mode)
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
|
|
@ -102,7 +104,8 @@
|
|||
}
|
||||
|
||||
$groups = $oMemberModel->getGroups();
|
||||
if(!count($groups)) {
|
||||
if(!count($groups))
|
||||
{
|
||||
// Set an administrator, regular member(group1), and associate member(group2)
|
||||
$group_args->title = Context::getLang('admin_group');
|
||||
$group_args->is_default = 'N';
|
||||
|
|
@ -125,9 +128,11 @@
|
|||
// Configure administrator information
|
||||
$admin_args->is_admin = 'Y';
|
||||
$output = executeQuery('member.getMemberList', $admin_args);
|
||||
if(!$output->data) {
|
||||
if(!$output->data)
|
||||
{
|
||||
$admin_info = Context::gets('password','nick_name','email_address');
|
||||
if($admin_info->email_address) {
|
||||
if($admin_info->email_address)
|
||||
{
|
||||
$admin_info->user_id = 'admin';
|
||||
$admin_info->user_name = 'admin';
|
||||
// Insert admin information
|
||||
|
|
@ -139,7 +144,8 @@
|
|||
// Register denied ID(default + module name)
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_list = $oModuleModel->getModuleList();
|
||||
foreach($module_list as $key => $val) {
|
||||
foreach($module_list as $key => $val)
|
||||
{
|
||||
$oMemberAdminController->insertDeniedID($val->module,'');
|
||||
}
|
||||
$oMemberAdminController->insertDeniedID('www','');
|
||||
|
|
@ -161,8 +167,9 @@
|
|||
* a method to check if successfully installed
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
function checkUpdate() {
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = &getModel('module');
|
||||
// check member directory (11/08/2007 added)
|
||||
|
|
@ -224,8 +231,9 @@
|
|||
* Execute update
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleController = &getController('module');
|
||||
// Check member directory
|
||||
|
|
@ -234,54 +242,65 @@
|
|||
FileHandler::makeDir('./files/member_extra_info/signature');
|
||||
FileHandler::makeDir('./files/member_extra_info/profile_image');
|
||||
// Add a column
|
||||
if (!$oDB->isColumnExists("member_auth_mail", "is_register")) {
|
||||
if(!$oDB->isColumnExists("member_auth_mail", "is_register"))
|
||||
{
|
||||
$oDB->addColumn("member_auth_mail", "is_register", "char", 1, "N", true);
|
||||
}
|
||||
// Add a column(site_srl) to "member_group_member" table (11/15/2008)
|
||||
if (!$oDB->isColumnExists("member_group_member", "site_srl")) {
|
||||
if(!$oDB->isColumnExists("member_group_member", "site_srl"))
|
||||
{
|
||||
$oDB->addColumn("member_group_member", "site_srl", "number", 11, 0, true);
|
||||
$oDB->addIndex("member_group_member", "idx_site_srl", "site_srl", false);
|
||||
}
|
||||
if (!$oDB->isColumnExists("member_group", "site_srl")) {
|
||||
if(!$oDB->isColumnExists("member_group", "site_srl"))
|
||||
{
|
||||
$oDB->addColumn("member_group", "site_srl", "number", 11, 0, true);
|
||||
$oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true);
|
||||
}
|
||||
if($oDB->isIndexExists("member_group","uni_member_group_title")) {
|
||||
if($oDB->isIndexExists("member_group","uni_member_group_title"))
|
||||
{
|
||||
$oDB->dropIndex("member_group","uni_member_group_title",true);
|
||||
}
|
||||
|
||||
// Add a column(list_order) to "member_group" table (05/18/2011)
|
||||
if (!$oDB->isColumnExists("member_group", "list_order")) {
|
||||
if(!$oDB->isColumnExists("member_group", "list_order"))
|
||||
{
|
||||
$oDB->addColumn("member_group", "list_order", "number", 11, '', true);
|
||||
$oDB->addIndex("member_group","idx_list_order", "list_order",false);
|
||||
$output = executeQuery('member.updateAllMemberGroupListOrder');
|
||||
}
|
||||
// Add a column for image_mark (02/14/2009)
|
||||
if(!$oDB->isColumnExists("member_group", "image_mark")) {
|
||||
if(!$oDB->isColumnExists("member_group", "image_mark"))
|
||||
{
|
||||
$oDB->addColumn("member_group", "image_mark", "text");
|
||||
}
|
||||
// Add a column for password expiration date
|
||||
if(!$oDB->isColumnExists("member", "change_password_date")) {
|
||||
if(!$oDB->isColumnExists("member", "change_password_date"))
|
||||
{
|
||||
$oDB->addColumn("member", "change_password_date", "date");
|
||||
executeQuery('member.updateAllChangePasswordDate');
|
||||
}
|
||||
|
||||
// Add columns of question and answer to verify a password
|
||||
if(!$oDB->isColumnExists("member", "find_account_question")) {
|
||||
if(!$oDB->isColumnExists("member", "find_account_question"))
|
||||
{
|
||||
$oDB->addColumn("member", "find_account_question", "number", 11);
|
||||
}
|
||||
if(!$oDB->isColumnExists("member", "find_account_answer")) {
|
||||
if(!$oDB->isColumnExists("member", "find_account_answer"))
|
||||
{
|
||||
$oDB->addColumn("member", "find_account_answer", "varchar", 250);
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists("member", "list_order")) {
|
||||
if(!$oDB->isColumnExists("member", "list_order"))
|
||||
{
|
||||
$oDB->addColumn("member", "list_order", "number", 11);
|
||||
set_time_limit(0);
|
||||
$args->list_order = 'member_srl';
|
||||
executeQuery('member.updateMemberListOrderAll',$args);
|
||||
executeQuery('member.updateMemberListOrderAll');
|
||||
}
|
||||
if(!$oDB->isIndexExists("member","idx_list_order")) {
|
||||
if(!$oDB->isIndexExists("member","idx_list_order"))
|
||||
{
|
||||
$oDB->addIndex("member","idx_list_order", array("list_order"));
|
||||
}
|
||||
|
||||
|
|
@ -301,7 +320,8 @@
|
|||
|
||||
$oMemberAdminController = &getAdminController('member');
|
||||
// check signup form ordering info
|
||||
if (!$config->signupForm || !is_array($config->signupForm)){
|
||||
if(!$config->signupForm || !is_array($config->signupForm))
|
||||
{
|
||||
$identifier = 'user_id';
|
||||
|
||||
$config->signupForm = $oMemberAdminController->createSignupForm($identifier);
|
||||
|
|
@ -348,13 +368,14 @@
|
|||
* Re-generate the cache file
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function recompileCache() {
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Record login error and return the error, about IPaddress.
|
||||
**/
|
||||
*/
|
||||
function recordLoginError($error = 0, $message = 'success')
|
||||
{
|
||||
if($error == 0) return new Object($error, $message);
|
||||
|
|
@ -398,7 +419,7 @@
|
|||
|
||||
/**
|
||||
* @brief Record login error and return the error, about MemberSrl.
|
||||
**/
|
||||
*/
|
||||
function recordMemberLoginError($error = 0, $message = 'success', $args = NULL)
|
||||
{
|
||||
if($error == 0 || !$args->member_srl) return new Object($error, $message);
|
||||
|
|
@ -430,4 +451,5 @@
|
|||
return $this->recordLoginError($error, $message);
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file member.class.php */
|
||||
/* Location: ./modules/member/member.class.php */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -64,4 +64,5 @@ class memberMobile extends memberView
|
|||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file member.mobile.php */
|
||||
/* Location: ./modules/member/member.mobile.php */
|
||||
|
|
|
|||
|
|
@ -3,24 +3,24 @@
|
|||
* @class memberModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Model class of the member module
|
||||
**/
|
||||
|
||||
class memberModel extends member {
|
||||
|
||||
*/
|
||||
class memberModel extends member
|
||||
{
|
||||
/**
|
||||
* @brief Keep data internally which may be frequently called ...
|
||||
**/
|
||||
*/
|
||||
var $join_form_list = NULL;
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return member's configuration
|
||||
**/
|
||||
*/
|
||||
function getMemberConfig()
|
||||
{
|
||||
static $member_config;
|
||||
|
|
@ -106,8 +106,9 @@
|
|||
|
||||
/**
|
||||
* @brief Display menus of the member
|
||||
**/
|
||||
function getMemberMenu() {
|
||||
*/
|
||||
function getMemberMenu()
|
||||
{
|
||||
// Get member_srl of he target member and logged info of the current user
|
||||
$member_srl = Context::get('target_srl');
|
||||
$mid = Context::get('cur_mid');
|
||||
|
|
@ -128,7 +129,8 @@
|
|||
|
||||
$oMemberController = &getController('member');
|
||||
// Display member information (Don't display to non-logged user)
|
||||
if($logged_info->member_srl) {
|
||||
if($logged_info->member_srl)
|
||||
{
|
||||
$url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl);
|
||||
$oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self');
|
||||
}
|
||||
|
|
@ -136,7 +138,8 @@
|
|||
if($member_srl != $logged_info->member_srl && $logged_info->member_srl)
|
||||
{
|
||||
// Send an email
|
||||
if($member_info->email_address) {
|
||||
if($member_info->email_address)
|
||||
{
|
||||
$url = 'mailto:'.htmlspecialchars($member_info->email_address);
|
||||
$oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path);
|
||||
}
|
||||
|
|
@ -150,7 +153,8 @@
|
|||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
|
||||
// Display a menu for editting member info to a top administrator
|
||||
if($logged_info->is_admin == 'Y') {
|
||||
if($logged_info->is_admin == 'Y')
|
||||
{
|
||||
$url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl);
|
||||
$oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo');
|
||||
|
||||
|
|
@ -163,7 +167,8 @@
|
|||
// Change a language of pop-up menu
|
||||
$menus = Context::get('member_popup_menu_list');
|
||||
$menus_count = count($menus);
|
||||
for($i=0;$i<$menus_count;$i++) {
|
||||
for($i=0;$i<$menus_count;$i++)
|
||||
{
|
||||
$menus[$i]->str = Context::getLang($menus[$i]->str);
|
||||
}
|
||||
// Get a list of finalized pop-up menu
|
||||
|
|
@ -172,7 +177,7 @@
|
|||
|
||||
/**
|
||||
* @brief Check if logged-in
|
||||
**/
|
||||
*/
|
||||
function isLogged() {
|
||||
if($_SESSION['is_logged']&&$_SESSION['ipaddress']==$_SERVER['REMOTE_ADDR']) return true;
|
||||
|
||||
|
|
@ -182,22 +187,28 @@
|
|||
|
||||
/**
|
||||
* @brief Return session information of the logged-in user
|
||||
**/
|
||||
function getLoggedInfo() {
|
||||
*/
|
||||
function getLoggedInfo()
|
||||
{
|
||||
// Return session info if session info is requested and the user is logged-in
|
||||
if($this->isLogged()) {
|
||||
if($this->isLogged())
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
// Admin/Group list defined depending on site_module_info
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
if($site_module_info->site_srl) {
|
||||
if($site_module_info->site_srl)
|
||||
{
|
||||
$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
|
||||
// Add is_site_admin bool variable into logged_info if site_administrator is
|
||||
$oModuleModel = &getModel('module');
|
||||
if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
|
||||
else $logged_info->is_site_admin = false;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Register a default group if the site doesn't have a member group
|
||||
if(!count($logged_info->group_list)) {
|
||||
if(!count($logged_info->group_list))
|
||||
{
|
||||
$default_group = $this->getDefaultGroup(0);
|
||||
$oMemberController = &getController('member');
|
||||
$oMemberController->addMemberToGroup($logged_info->member_srl, $default_group->group_srl, 0);
|
||||
|
|
@ -216,8 +227,9 @@
|
|||
|
||||
/**
|
||||
* @brief Return member information with user_id
|
||||
**/
|
||||
function getMemberInfoByUserID($user_id, $columnList = array()) {
|
||||
*/
|
||||
function getMemberInfoByUserID($user_id, $columnList = array())
|
||||
{
|
||||
if(!$user_id) return;
|
||||
|
||||
$args->user_id = $user_id;
|
||||
|
|
@ -232,8 +244,9 @@
|
|||
|
||||
/**
|
||||
* @brief Return member information with email_address
|
||||
**/
|
||||
function getMemberInfoByEmailAddress($email_address) {
|
||||
*/
|
||||
function getMemberInfoByEmailAddress($email_address)
|
||||
{
|
||||
if(!$email_address) return;
|
||||
|
||||
$args->email_address = $email_address;
|
||||
|
|
@ -247,8 +260,9 @@
|
|||
|
||||
/**
|
||||
* @brief Return member information with member_srl
|
||||
**/
|
||||
function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array()) {
|
||||
*/
|
||||
function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
|
||||
{
|
||||
if(!$member_srl) return;
|
||||
|
||||
//columnList size zero... get full member info
|
||||
|
|
@ -278,9 +292,11 @@
|
|||
|
||||
/**
|
||||
* @brief Add member info from extra_vars and other information
|
||||
**/
|
||||
function arrangeMemberInfo($info, $site_srl = 0) {
|
||||
if(!$GLOBALS['__member_info__'][$info->member_srl]) {
|
||||
*/
|
||||
function arrangeMemberInfo($info, $site_srl = 0)
|
||||
{
|
||||
if(!$GLOBALS['__member_info__'][$info->member_srl])
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
|
||||
|
|
@ -288,7 +304,8 @@
|
|||
$info->profile_image = $this->getProfileImage($info->member_srl);
|
||||
$info->image_name = $this->getImageName($info->member_srl);
|
||||
$info->image_mark = $this->getImageMark($info->member_srl);
|
||||
if($config->group_image_mark=='Y'){
|
||||
if($config->group_image_mark=='Y')
|
||||
{
|
||||
$info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl);
|
||||
}
|
||||
$info->signature = $this->getSignature($info->member_srl);
|
||||
|
|
@ -296,8 +313,10 @@
|
|||
|
||||
$extra_vars = unserialize($info->extra_vars);
|
||||
unset($info->extra_vars);
|
||||
if($extra_vars) {
|
||||
foreach($extra_vars as $key => $val) {
|
||||
if($extra_vars)
|
||||
{
|
||||
foreach($extra_vars as $key => $val)
|
||||
{
|
||||
if(!is_array($val)) if(preg_match('/\|\@\|/i', $val)) $val = explode('|@|', $val);
|
||||
if(!$info->{$key}) $info->{$key} = $val;
|
||||
}
|
||||
|
|
@ -335,8 +354,9 @@
|
|||
|
||||
/**
|
||||
* @brief Get member_srl corresponding to userid
|
||||
**/
|
||||
function getMemberSrlByUserID($user_id) {
|
||||
*/
|
||||
function getMemberSrlByUserID($user_id)
|
||||
{
|
||||
$args->user_id = $user_id;
|
||||
$output = executeQuery('member.getMemberSrl', $args);
|
||||
return $output->data->member_srl;
|
||||
|
|
@ -344,8 +364,9 @@
|
|||
|
||||
/**
|
||||
* @brief Get member_srl corresponding to EmailAddress
|
||||
**/
|
||||
function getMemberSrlByEmailAddress($email_address) {
|
||||
*/
|
||||
function getMemberSrlByEmailAddress($email_address)
|
||||
{
|
||||
$args->email_address = $email_address;
|
||||
$output = executeQuery('member.getMemberSrl', $args);
|
||||
return $output->data->member_srl;
|
||||
|
|
@ -353,8 +374,9 @@
|
|||
|
||||
/**
|
||||
* @brief Get member_srl corresponding to nickname
|
||||
**/
|
||||
function getMemberSrlByNickName($nick_name) {
|
||||
*/
|
||||
function getMemberSrlByNickName($nick_name)
|
||||
{
|
||||
$args->nick_name = $nick_name;
|
||||
$output = executeQuery('member.getMemberSrl', $args);
|
||||
return $output->data->member_srl;
|
||||
|
|
@ -362,16 +384,18 @@
|
|||
|
||||
/**
|
||||
* @brief Return member_srl of the current logged-in user
|
||||
**/
|
||||
function getLoggedMemberSrl() {
|
||||
*/
|
||||
function getLoggedMemberSrl()
|
||||
{
|
||||
if(!$this->isLogged()) return;
|
||||
return $_SESSION['member_srl'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return user_id of the current logged-in user
|
||||
**/
|
||||
function getLoggedUserID() {
|
||||
*/
|
||||
function getLoggedUserID()
|
||||
{
|
||||
if(!$this->isLogged()) return;
|
||||
$logged_info = Context::get('logged_info');
|
||||
return $logged_info->user_id;
|
||||
|
|
@ -379,17 +403,21 @@
|
|||
|
||||
/**
|
||||
* @brief Get a list of groups which the member_srl belongs to
|
||||
**/
|
||||
function getMemberGroups($member_srl, $site_srl = 0, $force_reload = false) {
|
||||
*/
|
||||
function getMemberGroups($member_srl, $site_srl = 0, $force_reload = false)
|
||||
{
|
||||
// cache controll
|
||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport()){
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_member_groups:'.$member_srl.'_'.$site_srl;
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
static $member_groups = array();
|
||||
if(!$member_groups[$member_srl][$site_srl] || $force_reload) {
|
||||
if(!$output){
|
||||
if(!$member_groups[$member_srl][$site_srl] || $force_reload)
|
||||
{
|
||||
if(!$output)
|
||||
{
|
||||
$args->member_srl = $member_srl;
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('member.getMemberGroups', $args);
|
||||
|
|
@ -398,11 +426,11 @@
|
|||
}
|
||||
if(!$output->data) return array();
|
||||
|
||||
|
||||
$group_list = $output->data;
|
||||
if(!is_array($group_list)) $group_list = array($group_list);
|
||||
|
||||
foreach($group_list as $group) {
|
||||
foreach($group_list as $group)
|
||||
{
|
||||
$result[$group->group_srl] = $group->title;
|
||||
}
|
||||
$member_groups[$member_srl][$site_srl] = $result;
|
||||
|
|
@ -412,8 +440,9 @@
|
|||
|
||||
/**
|
||||
* @brief Get a list of groups which member_srls belong to
|
||||
**/
|
||||
function getMembersGroups($member_srls, $site_srl = 0) {
|
||||
*/
|
||||
function getMembersGroups($member_srls, $site_srl = 0)
|
||||
{
|
||||
$args->member_srls = implode(',',$member_srls);
|
||||
$args->site_srl = $site_srl;
|
||||
$args->sort_index = 'list_order';
|
||||
|
|
@ -421,7 +450,8 @@
|
|||
if(!$output->data) return array();
|
||||
|
||||
$result = array();
|
||||
foreach($output->data as $key=>$val) {
|
||||
foreach($output->data as $key=>$val)
|
||||
{
|
||||
$result[$val->member_srl][] = $val->title;
|
||||
}
|
||||
return $result;
|
||||
|
|
@ -429,8 +459,9 @@
|
|||
|
||||
/**
|
||||
* @brief Get a default group
|
||||
**/
|
||||
function getDefaultGroup($site_srl = 0, $columnList = array()) {
|
||||
*/
|
||||
function getDefaultGroup($site_srl = 0, $columnList = array())
|
||||
{
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('member.getDefaultGroup', $args, $columnList);
|
||||
return $output->data;
|
||||
|
|
@ -438,16 +469,18 @@
|
|||
|
||||
/**
|
||||
* @brief Get an admin group
|
||||
**/
|
||||
function getAdminGroup($columnList = array()) {
|
||||
*/
|
||||
function getAdminGroup($columnList = array())
|
||||
{
|
||||
$output = executeQuery('member.getAdminGroup', $args, $columnList);
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get group info corresponding to group_srl
|
||||
**/
|
||||
function getGroup($group_srl, $columnList = array()) {
|
||||
*/
|
||||
function getGroup($group_srl, $columnList = array())
|
||||
{
|
||||
$args->group_srl = $group_srl;
|
||||
$output = executeQuery('member.getGroup', $args, $columnList);
|
||||
return $output->data;
|
||||
|
|
@ -455,8 +488,9 @@
|
|||
|
||||
/**
|
||||
* @brief Get a list of groups
|
||||
**/
|
||||
function getGroups($site_srl = 0) {
|
||||
*/
|
||||
function getGroups($site_srl = 0)
|
||||
{
|
||||
if(!$GLOBALS['__group_info__'][$site_srl])
|
||||
{
|
||||
$result = array();
|
||||
|
|
@ -500,13 +534,15 @@
|
|||
* This method works as an extend filter of modules/member/tpl/filter/insert.xml.
|
||||
* To use as extend_filter, the argument should be boolean.
|
||||
* When the argument is true, it returns object result in type of filter.
|
||||
**/
|
||||
function getJoinFormList($filter_response = false) {
|
||||
*/
|
||||
function getJoinFormList($filter_response = false)
|
||||
{
|
||||
global $lang;
|
||||
// Set to ignore if a super administrator.
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
if(!$this->join_form_list) {
|
||||
if(!$this->join_form_list)
|
||||
{
|
||||
// Argument setting to sort list_order column
|
||||
$args->sort_index = "list_order";
|
||||
$output = executeQuery('member.getJoinFormList', $args);
|
||||
|
|
@ -516,7 +552,8 @@
|
|||
// Need to unserialize because serialized array is inserted into DB in case of default_value
|
||||
if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
|
||||
$join_form_count = count($join_form_list);
|
||||
for($i=0;$i<$join_form_count;$i++) {
|
||||
for($i=0;$i<$join_form_count;$i++)
|
||||
{
|
||||
$join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name);
|
||||
|
||||
$member_join_form_srl = $join_form_list[$i]->member_join_form_srl;
|
||||
|
|
@ -527,10 +564,13 @@
|
|||
// Add language variable
|
||||
$lang->extend_vars[$column_name] = $column_title;
|
||||
// unserialize if the data type if checkbox, select and so on
|
||||
if(in_array($column_type, array('checkbox','select','radio'))) {
|
||||
if(in_array($column_type, array('checkbox','select','radio')))
|
||||
{
|
||||
$join_form_list[$i]->default_value = unserialize($default_value);
|
||||
if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$join_form_list[$i]->default_value = '';
|
||||
}
|
||||
|
||||
|
|
@ -539,9 +579,10 @@
|
|||
$this->join_form_list = $list;
|
||||
}
|
||||
// Get object style if the filter_response is true
|
||||
if($filter_response && count($this->join_form_list)) {
|
||||
|
||||
foreach($this->join_form_list as $key => $val) {
|
||||
if($filter_response && count($this->join_form_list))
|
||||
{
|
||||
foreach($this->join_form_list as $key => $val)
|
||||
{
|
||||
if($val->is_active != 'Y') continue;
|
||||
unset($obj);
|
||||
$obj->type = $val->column_type;
|
||||
|
|
@ -558,7 +599,6 @@
|
|||
|
||||
}
|
||||
return $filter_output;
|
||||
|
||||
}
|
||||
// Return the result
|
||||
return $this->join_form_list;
|
||||
|
|
@ -568,7 +608,7 @@
|
|||
* get used join form list.
|
||||
*
|
||||
* @return array $joinFormList
|
||||
**/
|
||||
*/
|
||||
function getUsedJoinFormList()
|
||||
{
|
||||
$args->sort_index = "list_order";
|
||||
|
|
@ -595,23 +635,27 @@
|
|||
|
||||
/**
|
||||
* @brief Combine extend join form and member information (used to modify member information)
|
||||
**/
|
||||
function getCombineJoinForm($member_info) {
|
||||
*/
|
||||
function getCombineJoinForm($member_info)
|
||||
{
|
||||
$extend_form_list = $this->getJoinFormlist();
|
||||
if(!$extend_form_list) return;
|
||||
// Member info is open only to an administrator and him/herself when is_private is true.
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
foreach($extend_form_list as $srl => $item) {
|
||||
foreach($extend_form_list as $srl => $item)
|
||||
{
|
||||
$column_name = $item->column_name;
|
||||
$value = $member_info->{$column_name};
|
||||
|
||||
if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_info->member_srl && $member_info->{'open_'.$column_name}!='Y') {
|
||||
if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_info->member_srl && $member_info->{'open_'.$column_name}!='Y')
|
||||
{
|
||||
$extend_form_list[$srl]->is_private = true;
|
||||
continue;
|
||||
}
|
||||
// Change values depening on the type of extend form
|
||||
switch($item->column_type) {
|
||||
switch($item->column_type)
|
||||
{
|
||||
case 'checkbox' :
|
||||
if($value && !is_array($value)) $value = array($value);
|
||||
break;
|
||||
|
|
@ -635,8 +679,9 @@
|
|||
|
||||
/**
|
||||
* @brief Get a join form
|
||||
**/
|
||||
function getJoinForm($member_join_form_srl) {
|
||||
*/
|
||||
function getJoinForm($member_join_form_srl)
|
||||
{
|
||||
$args->member_join_form_srl = $member_join_form_srl;
|
||||
$output = executeQuery('member.getJoinForm', $args);
|
||||
$join_form = $output->data;
|
||||
|
|
@ -645,9 +690,12 @@
|
|||
$column_type = $join_form->column_type;
|
||||
$default_value = $join_form->default_value;
|
||||
|
||||
if(in_array($column_type, array('checkbox','select','radio'))) {
|
||||
if(in_array($column_type, array('checkbox','select','radio')))
|
||||
{
|
||||
$join_form->default_value = unserialize($default_value);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$join_form->default_value = '';
|
||||
}
|
||||
|
||||
|
|
@ -656,9 +704,11 @@
|
|||
|
||||
/**
|
||||
* @brief Get a list of denied IDs
|
||||
**/
|
||||
function getDeniedIDList() {
|
||||
if(!$this->denied_id_list) {
|
||||
*/
|
||||
function getDeniedIDList()
|
||||
{
|
||||
if(!$this->denied_id_list)
|
||||
{
|
||||
$args->sort_index = "list_order";
|
||||
$args->page = Context::get('page');
|
||||
$args->list_count = 40;
|
||||
|
|
@ -670,7 +720,8 @@
|
|||
return $this->denied_id_list;
|
||||
}
|
||||
|
||||
function getDeniedIDs(){
|
||||
function getDeniedIDs()
|
||||
{
|
||||
$output = executeQueryArray('member.getDeniedIDs');
|
||||
if(!$output->toBool()) return array();
|
||||
return $output->data;
|
||||
|
|
@ -689,8 +740,9 @@
|
|||
|
||||
/**
|
||||
* @brief Verify if ID is denied
|
||||
**/
|
||||
function isDeniedID($user_id) {
|
||||
*/
|
||||
function isDeniedID($user_id)
|
||||
{
|
||||
$args->user_id = $user_id;
|
||||
$output = executeQuery('member.chkDeniedID', $args);
|
||||
if($output->data->count) return true;
|
||||
|
|
@ -699,7 +751,7 @@
|
|||
|
||||
/**
|
||||
* @brief Verify if nick name is denied
|
||||
**/
|
||||
*/
|
||||
function isDeniedNickName($nickName)
|
||||
{
|
||||
$args->nick_name = $nickName;
|
||||
|
|
@ -713,14 +765,18 @@
|
|||
}
|
||||
/**
|
||||
* @brief Get information of the profile image
|
||||
**/
|
||||
function getProfileImage($member_srl) {
|
||||
if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) {
|
||||
*/
|
||||
function getProfileImage($member_srl)
|
||||
{
|
||||
if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
|
||||
{
|
||||
$GLOBALS['__member_info__']['profile_image'][$member_srl] = null;
|
||||
$exts = array('gif','jpg','png');
|
||||
for($i=0;$i<3;$i++) {
|
||||
for($i=0;$i<3;$i++)
|
||||
{
|
||||
$image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]);
|
||||
if(file_exists($image_name_file)) {
|
||||
if(file_exists($image_name_file))
|
||||
{
|
||||
list($width, $height, $type, $attrs) = getimagesize($image_name_file);
|
||||
$info = null;
|
||||
$info->width = $width;
|
||||
|
|
@ -738,36 +794,44 @@
|
|||
|
||||
/**
|
||||
* @brief Get the image name
|
||||
**/
|
||||
function getImageName($member_srl) {
|
||||
if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) {
|
||||
*/
|
||||
function getImageName($member_srl)
|
||||
{
|
||||
if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
|
||||
{
|
||||
$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
|
||||
if(file_exists($image_name_file)) {
|
||||
if(file_exists($image_name_file))
|
||||
{
|
||||
list($width, $height, $type, $attrs) = getimagesize($image_name_file);
|
||||
$info->width = $width;
|
||||
$info->height = $height;
|
||||
$info->src = Context::getRequestUri().$image_name_file;
|
||||
$info->file = './'.$image_name_file;
|
||||
$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
|
||||
} else $GLOBALS['__member_info__']['image_name'][$member_srl] = null;
|
||||
}
|
||||
else $GLOBALS['__member_info__']['image_name'][$member_srl] = null;
|
||||
}
|
||||
return $GLOBALS['__member_info__']['image_name'][$member_srl];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the image mark
|
||||
**/
|
||||
function getImageMark($member_srl) {
|
||||
if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) {
|
||||
*/
|
||||
function getImageMark($member_srl)
|
||||
{
|
||||
if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
|
||||
{
|
||||
$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
|
||||
if(file_exists($image_mark_file)) {
|
||||
if(file_exists($image_mark_file))
|
||||
{
|
||||
list($width, $height, $type, $attrs) = getimagesize($image_mark_file);
|
||||
$info->width = $width;
|
||||
$info->height = $height;
|
||||
$info->src = Context::getRequestUri().$image_mark_file;
|
||||
$info->file = './'.$image_mark_file;
|
||||
$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
|
||||
} else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
|
||||
}
|
||||
else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
|
||||
}
|
||||
|
||||
return $GLOBALS['__member_info__']['image_mark'][$member_srl];
|
||||
|
|
@ -776,14 +840,15 @@
|
|||
|
||||
/**
|
||||
* @brief Get the image mark of the group
|
||||
**/
|
||||
*/
|
||||
function getGroupImageMark($member_srl,$site_srl=0)
|
||||
{
|
||||
if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
if($config->group_image_mark!='Y'){
|
||||
if($config->group_image_mark!='Y')
|
||||
{
|
||||
return null;
|
||||
}
|
||||
$member_group = $this->getMemberGroups($member_srl,$site_srl);
|
||||
|
|
@ -816,30 +881,36 @@
|
|||
|
||||
/**
|
||||
* @brief Get user's signature
|
||||
**/
|
||||
function getSignature($member_srl) {
|
||||
if(!isset($GLOBALS['__member_info__']['signature'][$member_srl])) {
|
||||
*/
|
||||
function getSignature($member_srl)
|
||||
{
|
||||
if(!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
|
||||
{
|
||||
$filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl);
|
||||
if(file_exists($filename)) {
|
||||
if(file_exists($filename))
|
||||
{
|
||||
$buff = FileHandler::readFile($filename);
|
||||
$signature = trim(substr($buff, 40));
|
||||
$GLOBALS['__member_info__']['signature'][$member_srl] = $signature;
|
||||
} else $GLOBALS['__member_info__']['signature'][$member_srl] = null;
|
||||
}
|
||||
else $GLOBALS['__member_info__']['signature'][$member_srl] = null;
|
||||
}
|
||||
return $GLOBALS['__member_info__']['signature'][$member_srl];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Compare plain text password to the password saved in DB
|
||||
**/
|
||||
function isValidPassword($hashed_password, $password_text, $member_srl=null) {
|
||||
*/
|
||||
function isValidPassword($hashed_password, $password_text, $member_srl=null)
|
||||
{
|
||||
// False if no password in entered
|
||||
if(!$password_text) return false;
|
||||
|
||||
$isSha1 = ($this->useSha1 && function_exists('sha1'));
|
||||
|
||||
// Return true if the user input is equal to md5 hash value
|
||||
if($hashed_password == md5($password_text)){
|
||||
if($hashed_password == md5($password_text))
|
||||
{
|
||||
if($isSha1 && $member_srl > 0)
|
||||
{
|
||||
$args = new stdClass();
|
||||
|
|
@ -852,7 +923,8 @@
|
|||
}
|
||||
|
||||
// Return true if the user input is equal to the value of mysql_pre4_hash_password
|
||||
if(mysql_pre4_hash_password($password_text) == $hashed_password){
|
||||
if(mysql_pre4_hash_password($password_text) == $hashed_password)
|
||||
{
|
||||
if($isSha1 && $member_srl > 0)
|
||||
{
|
||||
$args = new stdClass();
|
||||
|
|
@ -865,9 +937,11 @@
|
|||
}
|
||||
|
||||
// Verify the password by using old_password if the current db is MySQL. If correct, return true.
|
||||
if(substr(Context::getDBType(),0,5)=='mysql') {
|
||||
if(substr(Context::getDBType(),0,5)=='mysql')
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
if($oDB->isValidOldPassword($password_text, $hashed_password)){
|
||||
if($oDB->isValidOldPassword($password_text, $hashed_password))
|
||||
{
|
||||
if($isSha1 && $member_srl > 0)
|
||||
{
|
||||
$args = new stdClass();
|
||||
|
|
@ -903,4 +977,5 @@
|
|||
return $groupSrl;
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file member.model.php */
|
||||
/* Location: ./modules/member/member.model.php */
|
||||
|
|
|
|||
|
|
@ -3,18 +3,18 @@
|
|||
* @class memberView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief View class of member module
|
||||
**/
|
||||
|
||||
class memberView extends member {
|
||||
|
||||
*/
|
||||
class memberView extends member
|
||||
{
|
||||
var $group_list = NULL; // /< Group list information
|
||||
var $member_info = NULL; // /< Member information of the user
|
||||
var $skin = 'default';
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
// Get the member configuration
|
||||
$oMemberModel = &getModel('member');
|
||||
$this->member_config = $oMemberModel->getMemberConfig();
|
||||
|
|
@ -54,17 +54,21 @@
|
|||
|
||||
/**
|
||||
* @brief Display member information
|
||||
**/
|
||||
function dispMemberInfo() {
|
||||
*/
|
||||
function dispMemberInfo()
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
$logged_info = Context::get('logged_info');
|
||||
// Don't display member info to non-logged user
|
||||
if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
|
||||
|
||||
$member_srl = Context::get('member_srl');
|
||||
if(!$member_srl && Context::get('is_logged')) {
|
||||
if(!$member_srl && Context::get('is_logged'))
|
||||
{
|
||||
$member_srl = $logged_info->member_srl;
|
||||
} elseif(!$member_srl) {
|
||||
}
|
||||
elseif(!$member_srl)
|
||||
{
|
||||
return $this->dispMemberSignUpForm();
|
||||
}
|
||||
|
||||
|
|
@ -179,7 +183,7 @@
|
|||
|
||||
/**
|
||||
* @brief Display member join form
|
||||
**/
|
||||
*/
|
||||
function dispMemberSignUpForm()
|
||||
{
|
||||
//setcookie for redirect url in case of going to member sign up
|
||||
|
|
@ -212,7 +216,6 @@
|
|||
$this->setTemplateFile('signup_form');
|
||||
}
|
||||
|
||||
|
||||
function dispMemberModifyInfoBefore()
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -247,7 +250,7 @@
|
|||
|
||||
/**
|
||||
* @brief Modify member information
|
||||
**/
|
||||
*/
|
||||
function dispMemberModifyInfo()
|
||||
{
|
||||
if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
|
||||
|
|
@ -276,7 +279,8 @@
|
|||
Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info));
|
||||
|
||||
// Editor of the module set for signing by calling getEditor
|
||||
if($member_info->member_srl) {
|
||||
if($member_info->member_srl)
|
||||
{
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->primary_key_name = 'member_srl';
|
||||
$option->content_key_name = 'signature';
|
||||
|
|
@ -311,11 +315,11 @@
|
|||
$this->setTemplateFile('modify_info');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Display documents written by the member
|
||||
**/
|
||||
function dispMemberOwnDocument() {
|
||||
*/
|
||||
function dispMemberOwnDocument()
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
// A message appears if the user is not logged-in
|
||||
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
|
||||
|
|
@ -337,8 +341,9 @@
|
|||
|
||||
/**
|
||||
* @brief Display documents scrapped by the member
|
||||
**/
|
||||
function dispMemberScrappedDocument() {
|
||||
*/
|
||||
function dispMemberScrappedDocument()
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
// A message appears if the user is not logged-in
|
||||
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
|
||||
|
|
@ -359,8 +364,9 @@
|
|||
|
||||
/**
|
||||
* @brief Display documents saved by the member
|
||||
**/
|
||||
function dispMemberSavedDocument() {
|
||||
*/
|
||||
function dispMemberSavedDocument()
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
// A message appears if the user is not logged-in
|
||||
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
|
||||
|
|
@ -383,9 +389,11 @@
|
|||
|
||||
/**
|
||||
* @brief Display the login form
|
||||
**/
|
||||
function dispMemberLoginForm() {
|
||||
if(Context::get('is_logged')) {
|
||||
*/
|
||||
function dispMemberLoginForm()
|
||||
{
|
||||
if(Context::get('is_logged'))
|
||||
{
|
||||
Context::set('redirect_url', getNotEncodedUrl('act',''));
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('redirect.html');
|
||||
|
|
@ -404,7 +412,7 @@
|
|||
|
||||
/**
|
||||
* @brief Change the user password
|
||||
**/
|
||||
*/
|
||||
function dispMemberModifyPassword()
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
|
|
@ -436,8 +444,9 @@
|
|||
|
||||
/**
|
||||
* @brief Member withdrawl
|
||||
**/
|
||||
function dispMemberLeave() {
|
||||
*/
|
||||
function dispMemberLeave()
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
// A message appears if the user is not logged-in
|
||||
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
|
||||
|
|
@ -466,8 +475,9 @@
|
|||
|
||||
/**
|
||||
* @brief Member log-out
|
||||
**/
|
||||
function dispMemberLogout() {
|
||||
*/
|
||||
function dispMemberLogout()
|
||||
{
|
||||
$oMemberController = &getController('member');
|
||||
$output = $oMemberController->procMemberLogout();
|
||||
if(!$output->redirect_url)
|
||||
|
|
@ -481,15 +491,17 @@
|
|||
/**
|
||||
* @brief Display a list of saved articles
|
||||
* @Deplicated - instead Document View - dispTempSavedList method use
|
||||
**/
|
||||
function dispSavedDocumentList() {
|
||||
*/
|
||||
function dispSavedDocumentList()
|
||||
{
|
||||
return new Object(0, 'Deplicated method');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Find user ID and password
|
||||
**/
|
||||
function dispMemberFindAccount() {
|
||||
*/
|
||||
function dispMemberFindAccount()
|
||||
{
|
||||
if(Context::get('is_logged')) return $this->stop('already_logged');
|
||||
|
||||
$oMemberModel = &getModel('member');
|
||||
|
|
@ -502,8 +514,9 @@
|
|||
|
||||
/**
|
||||
* @brief Generate a temporary password
|
||||
**/
|
||||
function dispMemberGetTempPassword() {
|
||||
*/
|
||||
function dispMemberGetTempPassword()
|
||||
{
|
||||
if(Context::get('is_logged')) return $this->stop('already_logged');
|
||||
|
||||
$user_id = Context::get('user_id');
|
||||
|
|
@ -519,7 +532,7 @@
|
|||
|
||||
/**
|
||||
* @brief Page of re-sending an authentication mail
|
||||
**/
|
||||
*/
|
||||
function dispMemberResendAuthMail()
|
||||
{
|
||||
$authMemberSrl = $_SESSION['auth_member_srl'];
|
||||
|
|
@ -545,10 +558,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ?´ë©”??주소ë¥?기본 로그??ê³„ì • ?¬ìš©???´ë©”??주소 변경ì<EFBFBD>„ ?„한 ?”ë©´ ì¶”ê?
|
||||
**/
|
||||
function dispMemberModifyEmailAddress(){
|
||||
function dispMemberModifyEmailAddress()
|
||||
{
|
||||
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
|
||||
|
||||
$this->setTemplateFile('modify_email_address');
|
||||
|
|
@ -558,7 +569,8 @@
|
|||
* Add javascript codes into the header by checking values of member join form, required and others
|
||||
* @return void
|
||||
*/
|
||||
function addExtraFormValidatorMessage() {
|
||||
function addExtraFormValidatorMessage()
|
||||
{
|
||||
$oMemberModel = &getModel('member');
|
||||
$extraList = $oMemberModel->getUsedJoinFormList();
|
||||
|
||||
|
|
@ -579,7 +591,6 @@
|
|||
{
|
||||
$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s","%s"]);', $val->column_name, $val->column_title);
|
||||
}
|
||||
|
||||
$errorLang[$val->column_name] = $val->column_title;
|
||||
}
|
||||
$_SESSION['XE_VALIDATOR_ERROR_LANG'] = $errorLang;
|
||||
|
|
@ -591,4 +602,5 @@
|
|||
Context::addHtmlHeader($js_code);
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file member.view.php */
|
||||
/* Location: ./modules/member/member.view.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue