Jump to content
IPSViet.com

Abyss

Members
  • Content count

    11
  • Joined

  • Last visited

Community Reputation

4 Neutral

About Abyss

  • Rank
    Thành viên mới
  1. E đang muốn cho người dùng tự động theo dõi bài viết mỗi khi họ comment vào bài viết của ai đó để nhận thông báo trên mục notification mà không biết phải thiết lập ra sao. Mong dc các bác giúp đỡ ạ
  2. [SOLVED] [Trợ giúp] Di chuyển userbar

    Dạ vâng vậy để e thử nghiên cứu xem sao ạ.
  3. E đang muốn di chuyển userBar vào cùng vị trí với navBar mà không biết cách phải làm sao, e có tìm trong themes tới được vị trí hiển thị thanh userBar để xóa vị trí ở đó cùng với việc thêm vào ở navBar nhưng nó bị xuống dòng chứ không nằm cùng vị trí với navBar, các bác cho e xin hỏi cách để di chuyển nó nằm với vị trí của navBar với ạ Source userBar: <template template_group="global" template_name="userBar" template_data=" " template_location="front"><![CDATA[{{if \IPS\Member::loggedIn()->member_id }} <ul id='elUserNav' class='ipsList_inline cSignedIn ipsClearfix' data-controller='core.front.core.userbar{{if member.member_id && settings.auto_polling_enabled}},core.front.core.instantNotifications{{endif}}'> <li>{template="userPhoto" group="global" app="core" params="\IPS\Member::loggedIn(), 'tiny'"}</li> <li id='cUserLink'> <a href='#elUserLink_menu' id='elUserLink' data-ipsMenu> {{if isset( $_SESSION['logged_in_as_key'] )}}{lang="front_logged_in_as" sprintf="$_SESSION['logged_in_from']['name']"} {{endif}}{member="name"} <i class='fa fa-caret-down'></i> </a> <ul id='elUserLink_menu' class='ipsMenu ipsMenu_normal ipsHide'> <li class='ipsMenu_title'>{lang="menu_content"}</li> {{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) )}} <li class='ipsMenu_item' data-menuItem='profile'><a href='{member="url()"}' title='{lang="view_my_profile"}'>{lang="menu_profile"}</a></li> {{endif}} {{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) ) and \IPS\Member::loggedIn()->members_disable_pm AND \IPS\Member::loggedIn()->members_disable_pm != 2}} <li class='ipsMenu_item' data-menuItem='messages'><a href='{url="app=core&module=messaging&controller=messenger&do=enableMessenger" seoTemplate="messaging" csrf="true"}' title='{lang="go_to_messenger"}' data-confirm data-confirmMessage='{lang="messenger_disabled_msg"}'>{lang="menu_messages"}</a></li> {{endif}} {{if \IPS\Member::loggedIn()->group['g_attach_max'] != 0}} <li class='ipsMenu_item' data-menuItem='attachments'><a href='{url="app=core&module=system&controller=attachments" seoTemplate="attachments"}'>{lang="my_attachments"}</a></li> {{endif}} <li class='ipsMenu_title'>{lang="menu_settings_title"}</li> <li class='ipsMenu_item' data-menuItem='manageFollowed'><a href='{url="app=core&module=system&controller=followed" seoTemplate="followed_content"}'>{lang="menu_followed_content"}</a></li> <li class='ipsMenu_item' id='elAccountSettingsLink' data-menuItem='settings'><a href='{url="app=core&module=system&controller=settings" seoTemplate="settings"}' title='{lang="edit_account_settings"}'>{lang="menu_settings"}</a></li> <li class='ipsMenu_item' data-menuItem='ignoredUsers'><a href='{url="app=core&module=system&controller=ignore" seoTemplate="ignore"}'>{lang="menu_manage_ignore"}</a></li> <li class='ipsMenu_sep'><hr></li> {{if ( \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'modcp' ) ) AND \IPS\Member::loggedIn()->modPermission() ) or \IPS\Member::loggedIn()->isAdmin()}} {{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'modcp' ) ) AND \IPS\Member::loggedIn()->modPermission()}} <li class='ipsMenu_item' data-menuItem='modcp'><a href='{url="app=core&module=modcp" seoTemplate="modcp"}'>{lang="menu_modcp"}</a></li> {{endif}} {{if \IPS\Member::loggedIn()->isAdmin() AND !\IPS\Settings::i()->security_remove_acp_link }} <li class='ipsMenu_item' data-menuItem='admincp'><a href='{url="" base="admin"}' target='_blank'>{lang="menu_admincp"}</a></li> {{endif}} <li class='ipsMenu_sep'><hr></li> {{endif}} <li class='ipsMenu_item' data-menuItem='signout'> <a href='{url="app=core&module=system&controller=login&do=logout" csrf="true" seoTemplate="logout"}'>{{if isset( $_SESSION['logged_in_as_key'] )}}{lang="switch_to_account" sprintf="$_SESSION['logged_in_from']['name']"}{{else}}{lang="sign_out"}{{endif}}</a> </li> </ul> </li> {{if !\IPS\Member::loggedIn()->restrict_post and count( \IPS\Member::loggedIn()->createMenu() )}} <li id='cCreate'> <a href='#elCreateNew_menu' id='elCreateNew' data-ipsTooltip data-ipsMenu title='{lang="create_menu_title"}'> <strong><i class='fa fa-plus'></i> &nbsp;{lang="create_menu"}</strong> <i class='fa fa-caret-down'></i> </a> <div id='elCreateNew_menu' class='ipsMenu ipsMenu_auto ipsHide'> <ul> {{foreach \IPS\Member::loggedIn()->createMenu() as $k => $url}} <li class="ipsMenu_item"> <a href="{$url['link']}" {{if isset( $url['extraData'] )}} {{foreach $url['extraData'] as $data => $v}} {$data}="{$v}" {{endforeach}} {{endif}} {{if isset($url['title']) AND $url['title']}} data-ipsDialog-title='{lang="$url['title']"}'{{endif}} {{if isset($url['flashMessage'])}} data-ipsdialog-flashmessage="{lang="$url['flashMessage']"}"{{endif}} >{lang="$k"}</a> </li> {{endforeach}} </ul> </div> </li> {{endif}} <li class='cNotifications cUserNav_icon'> <a href='{url="app=core&module=system&controller=notifications" seoTemplate="notifications"}' id='elFullNotifications' data-ipsTooltip title='{lang="userbar_notifications"}' data-ipsMenu data-ipsMenu-closeOnClick='false'> <i class='fa fa-bell'></i> <span class='ipsNotificationCount {{if !member.notification_cnt}}ipsHide{{endif}}' data-notificationType='notify' data-currentCount='{member="notification_cnt"}'>{member="notification_cnt"}</span> </a> <div id='elFullNotifications_menu' class='ipsMenu ipsMenu_wide ipsHide'> <div class='ipsMenu_headerBar'> <a href="{url="app=core&module=system&controller=notifications&do=options" seoTemplate="notifications_options"}" class="ipsType_light ipsPos_right"><i class="fa fa-cog"></i> {lang="notification_options"}</a> <h4 class='ipsType_sectionHead'>{lang="notifications"}</h4> </div> <div class='ipsMenu_innerContent'> <ol class='ipsDataList ipsDataList_readStatus' data-role='notifyList' data-ipsKeyNav data-ipsKeyNav-observe='return' id='elNotifyContent'></ol> </div> <div class='ipsMenu_footerBar ipsType_center'> <a href='{url="app=core&module=system&controller=notifications" seoTemplate="notifications"}'><i class='fa fa-bars'></i> {lang="see_all_notifications"}</a> </div> </div> </li> {{if !\IPS\Member::loggedIn()->members_disable_pm and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) )}} <li class='cInbox cUserNav_icon'> <a href='{url="app=core&module=messaging&controller=messenger" seoTemplate="messaging"}' id='elFullInbox' data-ipsTooltip title='{lang="userbar_messages"}' data-ipsMenu data-ipsMenu-closeOnClick='false'> <i class='fa fa-envelope'></i> <span class='ipsNotificationCount {{if !\IPS\Member::loggedIn()->msg_count_new}}ipsHide{{endif}}' data-notificationType='inbox' data-currentCount='{member="msg_count_new"}'>{member="msg_count_new"}</span> </a> <div id='elFullInbox_menu' class='ipsMenu ipsMenu_wide ipsHide' data-controller='core.front.core.messengerMenu'> <div class='ipsMenu_headerBar'> <a href='{url="app=core&module=messaging&controller=messenger&do=compose" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}" id='elMessengerPopup_compose' class='ipsPos_right ipsButton ipsButton_primary ipsButton_verySmall'>{lang="compose_new"}</a> <h4 class='ipsType_sectionHead'>{lang="inbox"}</h4> </div> <div class='ipsMenu_innerContent'><ol class='ipsDataList' data-role='inboxList' data-ipsKeyNav data-ipsKeyNav-observe='return' id='elInboxContent'></ol></div> <div class='ipsMenu_footerBar ipsType_center'> <a href='{url="app=core&module=messaging&controller=messenger" seoTemplate="messaging"}'><i class='fa fa-bars'></i> {lang="go_to_inbox"}</a> </div> </div> </li> {{endif}} {{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'modcp' ) ) and \IPS\Member::loggedIn()->modPermission('can_view_reports')}} <li class='cReports cUserNav_icon'> <a href='{url="app=core&module=modcp&controller=modcp&tab=reports" seoTemplate="modcp_reports"}' id='elFullReports' data-ipsTooltip title='{lang="userbar_reports"}' data-ipsMenu data-ipsMenu-closeOnClick='false'> <i class='fa fa-warning'></i> {{if \IPS\Member::loggedIn()->reportCount()}}<span class='ipsNotificationCount' data-notificationType='reports'>{member="reportCount()"}</span>{{endif}} </a> <div id='elFullReports_menu' class='ipsMenu ipsMenu_wide ipsHide'> <div class='ipsMenu_headerBar'><h4 class='ipsType_sectionHead'>{lang="report_center_header"}</h4></div> <div class='ipsMenu_innerContent' data-role="reportsList"></div> <div class='ipsMenu_footerBar ipsType_center'> <a href='{url="app=core&module=modcp&controller=modcp&tab=reports" seoTemplate="modcp_reports"}'><i class='fa fa-bars'></i> {lang="report_center_link"}</a> </div> </div> </li> {{endif}} {{if theme.ipsf_backgroundType === 'ipsfocus_backgroundPicker'}} {{if theme.pickerGroups === "" OR member.inGroup( explode(',', theme.pickerGroups) ) }} <li class='cUserNav_icon'> <a href='#' class='ipsfocus_toggleBgPicker' data-ipsTooltip title='{theme="pickerThumbnailText"}'> <i class='fa fa-paint-brush'></i> </a> </li> {{endif}}{{endif}} </ul> {{else}} <ul id='elUserNav' class='ipsList_inline cSignedOut ipsClearfix'> <li id='elSignInLink'> <a href='{url="app=core&module=system&controller=login" seoTemplate="login" protocol="\IPS\Settings::i()->logins_over_https"}' data-ipsMenu-closeOnClick="false" data-ipsMenu id='elUserSignIn'> {lang="sign_in"} &nbsp;<i class='fa fa-caret-down'></i> </a> {template="loginPopup" app="core" group="global" params="new \IPS\Login( \IPS\Http\Url::internal( 'app=core&module=system&controller=login', 'front', 'login', NULL, \IPS\Settings::i()->logins_over_https ) )"} </li> {{if \IPS\Settings::i()->allow_reg}} <li> <a href='{url="app=core&module=system&controller=register" seoTemplate="register"}' id='elRegisterButton'> {lang="sign_up"} </a> </li> {{endif}} {{if theme.ipsf_backgroundType === 'ipsfocus_backgroundPicker'}} {{if theme.pickerGroups === "" OR member.inGroup( explode(',', theme.pickerGroups) ) }} <li class='cUserNav_icon'> <a href='#' class='ipsfocus_toggleBgPicker' data-ipsTooltip title='{theme="pickerThumbnailText"}'> <i class='fa fa-paint-brush'></i> </a> </li> {{endif}}{{endif}} </ul> {{endif}}]]></template> Source navBar <template template_group="global" template_name="navBarItems" template_data="$roots, $subBars=NULL, $parent=0, $preview=FALSE" template_location="front"><![CDATA[{{foreach $roots as $id => $item}} {{if $preview or $item->canView()}} {{$active = $item->activeOrChildActive();}} {{if $active}} {{\IPS\core\FrontNavigation::i()->activePrimaryNavBar = $item->id;}} {{endif}} <li {{if $active}}class='ipsNavBar_active' data-active{{endif}} id='elNavSecondary_{$item->id}' data-role="navBarItem" data-navApp="{expression="mb_substr( get_class( $item ), 4, mb_strpos( get_class( $item ), '\\', 4 ) - 4 )"}" data-navExt="{expression="mb_substr( get_class( $item ), mb_strrpos( get_class( $item ), '\\' ) + 1 )"}" data-navTitle="{$item->title()}"> {{$children = $item->children();}} {{if $children}} <a href="{{if $item->link()}}{$item->link()}{{else}}#{{endif}}" id="elNavigation_{$id}" data-ipsMenu data-ipsMenu-appendTo='#{{if $parent}}elNavSecondary_{$parent}{{else}}elNavSecondary_{$id}{{endif}}' data-ipsMenu-activeClass='ipsNavActive_menu' data-navItem-id="{$item->id}" {{if $active}}data-navDefault{{endif}}> {$item->title()} <i class="fa fa-caret-down"></i> </a> <ul id="elNavigation_{$id}_menu" class="ipsMenu ipsMenu_auto ipsHide"> {template="navBarChildren" app="core" group="global" location="front" params="$children, $preview"} </ul> {{else}} <a href="{{if $item->link()}}{$item->link()}{{else}}#{{endif}}" {{if method_exists( $item, 'target' ) AND $item->target()}}target='{$item->target()}'{{endif}} data-navItem-id="{$item->id}" {{if $active}}data-navDefault{{endif}} {{if $subBars && isset( $subBars[ $id ] ) && count( $subBars[ $id ] )}}data-hover=''{{endif}}> {$item->title()}{{if $subBars && isset( $subBars[ $id ] ) && count( $subBars[ $id ] )}} <i class="fa fa-caret-down"></i>{{endif}} </a> {{endif}} {{if $subBars && isset( $subBars[ $id ] ) && count( $subBars[ $id ] )}} <ul class='ipsNavBar_secondary {{if !$active}}ipsHide{{endif}}' data-role='secondaryNavBar'> {template="navBarItems" app="core" group="global" location="front" params="$subBars[ $id ], NULL, $item->id, $preview"} <li class='ipsHide' id='elNavigationMore_{$id}' data-role='navMore'> <a href='#' data-ipsMenu data-ipsMenu-appendTo='#elNavigationMore_{$id}' id='elNavigationMore_{$id}_dropdown'>{lang="more"} <i class='fa fa-caret-down'></i></a> <ul class='ipsHide ipsMenu ipsMenu_auto' id='elNavigationMore_{$id}_dropdown_menu' data-role='moreDropdown'></ul> </li> </ul> {{endif}} </li> {{endif}} {{endforeach}} ]]></template>
  4. E cảm ơn bác ạ, e đã thao tác được rồi :D. E lại đăng nốt Source backup lên đây tránh sau còn biết đường mà tìm lại protected function manage() { /* Build the form */ $form = new \IPS\Helpers\Form( "lostpass", 'request_password' ); $form->add( new \IPS\Helpers\Form\Email( 'email_address', NULL, TRUE, array( 'bypassProfanity' => TRUE ), function( $val ){ /* Check email exists */ $member = \IPS\Member::load( $val, 'email' ); if( !$member->member_id ) { throw new \LogicException( 'lost_pass_no_email' ); } }) ); \IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('lost_password'); /* Handle the reset */ if ( $values = $form->values() ) { /* Load the member */ $member = \IPS\Member::load( $values['email_address'], 'email' ); /* If we have an existing validation record, we can just reuse it */ $sendEmail = TRUE; try { $existing = \IPS\Db::i()->select( array( 'vid', 'email_sent' ), 'core_validating', array( 'member_id=? AND lost_pass=1', $member->member_id ) )->first(); $vid = $existing['vid']; /* If we sent a lost password email within the last 15 minutes, don't send another one otherwise someone could be a nuisence */ if ( $existing['email_sent'] and $existing['email_sent'] > ( time() - 900 ) ) { $sendEmail = FALSE; } else { \IPS\Db::i()->update( 'core_validating', array( 'email_sent' => time() ), array( 'vid=?', $vid ) ); } } catch ( \UnderflowException $e ) { $vid = md5( $member->members_pass_hash . \IPS\Login::generateRandomString() ); \IPS\Db::i()->insert( 'core_validating', array( 'vid' => $vid, 'member_id' => $member->member_id, 'entry_date' => time(), 'lost_pass' => 1, 'ip_address' => $member->ip_address, 'email_sent' => time(), ) ); } /* Send email */ if ( $sendEmail ) { \IPS\Email::buildFromTemplate( 'core', 'lost_password_init', array( $member, $vid ), \IPS\Email::TYPE_TRANSACTIONAL )->send( $member ); $message = "lost_pass_confirm"; } else { $message = "lost_pass_too_soon"; } /* Show confirmation page with further instructions */ \IPS\Output::i()->sidebar['enabled'] = FALSE; \IPS\Output::i()->bodyClasses[] = 'ipsLayout_minimal'; \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->lostPassConfirm( $message ); } else { \IPS\Output::i()->sidebar['enabled'] = FALSE; \IPS\Output::i()->bodyClasses[] = 'ipsLayout_minimal'; \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->lostPass( $form ); } }
  5. E đã xóa nội dung bên trong 2 function trên nhưng chức năng quên mật khẩu vẫn hoạt động ạ, không biết lý do vì sao
  6. Còn 1 cái quên mật khẩu, không biết phải tắt ở chỗ nào nhỉ bác, bác chỉ giúp e nốt với ạ
  7. E cảm ơn bác, e đã làm được rồi, e cũng tìm được cái phần email từ cách trên Cho phép e gắn mã mặc định vào bài viết này để backup ạ protected function _username() { /* Check they have permission to change their username */ if( !\IPS\Member::loggedIn()->group['g_dname_changes'] ) { \IPS\Output::i()->error( 'username_err_nochange', '1C122/4', 403, '' ); } if ( \IPS\Member::loggedIn()->group['g_displayname_unit'] ) { if ( \IPS\Member::loggedIn()->group['gbw_displayname_unit_type'] ) { if ( \IPS\Member::loggedIn()->joined->diff( \IPS\DateTime::create() )->days < \IPS\Member::loggedIn()->group['g_displayname_unit'] ) { \IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack( 'username_err_days', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->joined->add( new \DateInterval( 'P' . \IPS\Member::loggedIn()->group['g_displayname_unit'] . 'D' ) )->localeDate() ), 'pluralize' => array( \IPS\Member::loggedIn()->group['g_displayname_unit'] ) ) ), '1C122/5', 403, '' ); } } else { if ( \IPS\Member::loggedIn()->member_posts < \IPS\Member::loggedIn()->group['g_displayname_unit'] ) { \IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack( 'username_err_posts' , FALSE, array( 'sprintf' => array( ( \IPS\Member::loggedIn()->group['g_displayname_unit'] - \IPS\Member::loggedIn()->member_posts ) ), 'pluralize' => array( \IPS\Member::loggedIn()->group['g_displayname_unit'] ) ) ), '1C122/6', 403, '' ); } } } /* How many changes */ $nameCount = \IPS\Db::i()->select( 'COUNT(*) as count, MIN(dname_date) as min_date', 'core_dnames_change', array( 'dname_member_id=? AND dname_date>?', \IPS\Member::loggedIn()->member_id, \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Member::loggedIn()->group['g_dname_date'] . 'D' ) )->getTimestamp() ) )->first(); if ( \IPS\Member::loggedIn()->group['g_dname_changes'] != -1 and $nameCount['count'] >= \IPS\Member::loggedIn()->group['g_dname_changes'] ) { return \IPS\Theme::i()->getTemplate( 'system' )->settingsUsernameLimitReached( \IPS\Member::loggedIn()->language()->addToStack('username_err_limit', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->group['g_dname_date'] ), 'pluralize' => array( \IPS\Member::loggedIn()->group['g_dname_changes'] ) ) ) ); } else { /* Build form */ $form = new \IPS\Helpers\Form; $form->class = 'ipsForm_collapseTablet'; $form->add( new \IPS\Helpers\Form\Text( 'new_username', '', TRUE, array( 'accountUsername' => \IPS\Member::loggedIn() ) ) ); /* Handle submissions */ if ( $values = $form->values() ) { $oldName = \IPS\Member::loggedIn()->name; foreach ( \IPS\Login::handlers( TRUE ) as $handler ) { /* We cannot update our username in some login handlers, that's ok */ try { $handler->changeUsername( \IPS\Member::loggedIn(), $oldName, $values['new_username'] ); } catch( \BadMethodCallException $e ){} } \IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=username', 'front', 'settings' ), 'username_changed' ); } } return \IPS\Theme::i()->getTemplate( 'system' )->settingsUsername( $form, $nameCount['count'], \IPS\Member::loggedIn()->group['g_dname_changes'], $nameCount['min_date'] ? \IPS\DateTime::ts( $nameCount['min_date'] ) : \IPS\Member::loggedIn()->joined, \IPS\Member::loggedIn()->group['g_dname_date'] ); } protected function _password() { if( \IPS\Member::loggedIn()->isAdmin() ) { return \IPS\Theme::i()->getTemplate( 'system' )->settingsPassword(); } $mfaOutput = \IPS\MFA\MFAHandler::accessToArea( 'core', 'PasswordChange', \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=password', 'front', 'settings_password' ) ); if ( $mfaOutput ) { if ( \IPS\Request::i()->isAjax() ) { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=mfa', 'front', 'settings_mfa' ) ); } \IPS\Output::i()->output = $mfaOutput; } $form = new \IPS\Helpers\Form; $form->class = 'ipsForm_collapseTablet'; $form->add( new \IPS\Helpers\Form\Password( 'current_password', '', TRUE, array( 'validateFor' => \IPS\Member::loggedIn() ) ) ); $form->add( new \IPS\Helpers\Form\Password( 'new_password', '', TRUE, array( 'showMeter' => \IPS\Settings::i()->password_strength_meter ) ) ); $form->add( new \IPS\Helpers\Form\Password( 'confirm_new_password', '', TRUE, array( 'confirm' => 'new_password' ) ) ); if ( !$mfaOutput and $values = $form->values() ) { foreach ( \IPS\Login::handlers( TRUE ) as $handler ) { /* We cannot update our password in some login handlers, that's ok */ try { $handler->changePassword( \IPS\Member::loggedIn(), $values['new_password'] ); } catch( \BadMethodCallException $e ){} } /* If we have a pass_hash cookie, update it so we stay logged in on the next page load */ if( isset( \IPS\Request::i()->cookie['pass_hash'] ) ) { $expire = new \IPS\DateTime; $expire->add( new \DateInterval( 'P3M' ) ); \IPS\Request::i()->setCookie( 'pass_hash', \IPS\Member::loggedIn()->member_login_key, $expire ); } /* Send a confirmation email */ \IPS\Email::buildFromTemplate( 'core', 'password_changed', array(), \IPS\Email::TYPE_TRANSACTIONAL )->send( \IPS\Member::loggedIn(), array(), array(), NULL, NULL, array( 'Reply-To' => \IPS\Settings::i()->email_in ) ); \IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=password', 'front', 'settings' ), 'password_changed' ); } return \IPS\Theme::i()->getTemplate( 'system' )->settingsPassword( $form ); } protected function _email() { if( \IPS\Member::loggedIn()->isAdmin() ) { return \IPS\Theme::i()->getTemplate( 'system' )->settingsEmail(); } $mfaOutput = \IPS\MFA\MFAHandler::accessToArea( 'core', 'EmailChange', \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=password', 'front', 'settings_password' ) ); if ( $mfaOutput ) { if ( \IPS\Request::i()->isAjax() ) { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=mfa', 'front', 'settings_mfa' ) ); } \IPS\Output::i()->output = $mfaOutput; } /* Do we have any pending validation emails? */ try { $pending = \IPS\Db::i()->select( '*', 'core_validating', array( 'member_id=? AND email_chg=1', \IPS\Member::loggedIn()->member_id ), 'entry_date DESC' )->first(); } catch( \UnderflowException $e ) { $pending = null; } /* Build the form */ $form = new \IPS\Helpers\Form; $form->class = 'ipsForm_collapseTablet'; $form->addDummy( 'current_email', htmlspecialchars( \IPS\Member::loggedIn()->email, \IPS\HTMLENTITIES, 'UTF-8', FALSE ) ); $form->add( new \IPS\Helpers\Form\Email( 'new_email', '', TRUE, array( 'accountEmail' => TRUE ) ) ); $form->add( new \IPS\Helpers\Form\Password( 'current_password', '', TRUE, array( 'validateFor' => \IPS\Member::loggedIn() ) ) ); /* Handle submissions */ if ( !$mfaOutput and $values = $form->values() ) { $oldEmail = \IPS\Member::loggedIn()->email; /* Change the email */ foreach ( \IPS\Login::handlers( TRUE ) as $handler ) { /* We cannot update our email address in some login handlers, that's ok */ try { $handler->changeEmail( \IPS\Member::loggedIn(), $oldEmail, $values['new_email'] ); } catch( \BadMethodCallException $e ){} } /* Delete any pending validation emails */ if ( $pending['vid'] ) { \IPS\Db::i()->delete( 'core_validating', array( 'member_id=? AND email_chg=1', \IPS\Member::loggedIn()->member_id ) ); } /* Send a validation email if we need to */ if ( \IPS\Settings::i()->reg_auth_type == 'user' or \IPS\Settings::i()->reg_auth_type == 'admin_user' ) { $vid = \IPS\Login::generateRandomString(); \IPS\Db::i()->insert( 'core_validating', array( 'vid' => $vid, 'member_id' => \IPS\Member::loggedIn()->member_id, 'entry_date' => time(), 'email_chg' => TRUE, 'ip_address' => \IPS\Request::i()->ipAddress(), 'prev_email' => $oldEmail, 'email_sent' => time(), ) ); \IPS\Member::loggedIn()->members_bitoptions['validating'] = TRUE; \IPS\Member::loggedIn()->save(); \IPS\Email::buildFromTemplate( 'core', 'email_change', array( \IPS\Member::loggedIn(), $vid ), \IPS\Email::TYPE_TRANSACTIONAL )->send( \IPS\Member::loggedIn() ); \IPS\Output::i()->redirect( \IPS\Http\Url::internal( '' ) ); } /* Or just redirect */ else { /* Send a confirmation email */ \IPS\Email::buildFromTemplate( 'core', 'email_address_changed', array( \IPS\Member::loggedIn(), $oldEmail ), \IPS\Email::TYPE_TRANSACTIONAL )->send( $oldEmail, array(), array(), NULL, NULL, array( 'Reply-To' => \IPS\Settings::i()->email_in ) ); \IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=email', 'front', 'settings' ), 'email_changed' ); } } return \IPS\Theme::i()->getTemplate( 'system' )->settingsEmail( $form ); }
  8. À e tìm thấy rồi ạ, bác cho e hỏi chút có cách nào Disable từng phần không ạ, 1 số cái trong setting e cũng muốn cho người dùng có thể thiết lập chỉ ngoại trừ cái phần đổi mk, email thôi có được không nhỉ bác
  9. E cảm ơn bác, cơ mà link Admin CP của e là dạng admin/?adsess=r4kkqb73jd783v6m6l0pnv94b0&app=core&module=applications&controller=applications không biết phải làm sao để vào cái settings.php đó ạ
  10. Chào các bác, e đang chạy Forum sử dụng Rest API để kết nối tới csdl game nên đã tắt đăng ký trên diễn đàn chính nhưng vẫn còn 1 số mục của diễn đàn có thể gây mất sync với database như đổi mật khẩu, quên mật khẩu, đổi email các thứ trong phần Profile setting, Login nên có cách nào có thể ẩn các chức năng trên với user không ạ. Với cả Themes e đang dùng cũng hơi bị rộng ở phần Width, có cách nào để chỉnh lại độ rộng của khung trang không ạ và cái avatar size trong bài viết, nhiều hình ảnh lớn bị vỡ khung avatar. E không rành về khoản ngôn ngữ script web lắm (E viết game) nên không biết phải làm thế nào, mong được các bác hướng dẫn trợ giúp ạ. E xin cảm ơn trước.
×