@@ 731-752 (lines=22) @@ | ||
728 | * |
|
729 | * @return void|BaseObject (void : success, BaseObject : fail) |
|
730 | */ |
|
731 | function procMemberInsertProfileImage() |
|
732 | { |
|
733 | // Check if the file is successfully uploaded |
|
734 | $file = $_FILES['profile_image']; |
|
735 | if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); |
|
736 | // Ignore if member_srl is invalid or doesn't exist. |
|
737 | $member_srl = Context::get('member_srl'); |
|
738 | if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
739 | ||
740 | $logged_info = Context::get('logged_info'); |
|
741 | if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
742 | // Return if member module is set not to use an image name or the user is not an administrator ; |
|
743 | $oMemberModel = getModel('member'); |
|
744 | $config = $oMemberModel->getMemberConfig(); |
|
745 | if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image'); |
|
746 | ||
747 | $output = $this->insertProfileImage($member_srl, $file['tmp_name']); |
|
748 | if(!$output->toBool()) return $output; |
|
749 | ||
750 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
|
751 | $this->setRedirectUrl($returnUrl); |
|
752 | } |
|
753 | ||
754 | /** |
|
755 | * Insert a profile image |
|
@@ 835-859 (lines=25) @@ | ||
832 | * |
|
833 | * @return void|BaseObject (void : success, BaseObject : fail) |
|
834 | */ |
|
835 | function procMemberInsertImageName() |
|
836 | { |
|
837 | // Check if the file is successfully uploaded |
|
838 | $file = $_FILES['image_name']; |
|
839 | if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
840 | // Ignore if member_srl is invalid or doesn't exist. |
|
841 | $member_srl = Context::get('member_srl'); |
|
842 | if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
843 | ||
844 | $logged_info = Context::get('logged_info'); |
|
845 | if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
846 | // Return if member module is set not to use an image name or the user is not an administrator ; |
|
847 | $oMemberModel = getModel('member'); |
|
848 | $config = $oMemberModel->getMemberConfig(); |
|
849 | if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
850 | ||
851 | $output = $this->insertImageName($member_srl, $file['tmp_name']); |
|
852 | if(!$output->toBool()) return $output; |
|
853 | ||
854 | // Page refresh |
|
855 | //$this->setRefreshPage(); |
|
856 | ||
857 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
|
858 | $this->setRedirectUrl($returnUrl); |
|
859 | } |
|
860 | ||
861 | /** |
|
862 | * Insert a image name |
|
@@ 981-1002 (lines=22) @@ | ||
978 | * |
|
979 | * @return void|BaseObject (void : success, BaseObject : fail) |
|
980 | */ |
|
981 | function procMemberInsertImageMark() |
|
982 | { |
|
983 | // Check if the file is successfully uploaded |
|
984 | $file = $_FILES['image_mark']; |
|
985 | if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
986 | // Ignore if member_srl is invalid or doesn't exist. |
|
987 | $member_srl = Context::get('member_srl'); |
|
988 | if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
989 | ||
990 | $logged_info = Context::get('logged_info'); |
|
991 | if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
992 | // Membership in the images mark the module using the ban was set by an administrator or return; |
|
993 | $oMemberModel = getModel('member'); |
|
994 | $config = $oMemberModel->getMemberConfig(); |
|
995 | if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
996 | ||
997 | $this->insertImageMark($member_srl, $file['tmp_name']); |
|
998 | if(!$output->toBool()) return $output; |
|
999 | ||
1000 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
|
1001 | $this->setRedirectUrl($returnUrl); |
|
1002 | } |
|
1003 | ||
1004 | /** |
|
1005 | * Insert a image mark |