ThinkSNS registered username and email address and UC communication repair

While researching TS today, I discovered various communication issues between it and UC. After configuring UC and everything seemed normal, the following problems occurred:

  1. You can use a username and password that are already in the UC table when registering.
  2. Username changes are not syncing with UC form (new record added).
  3. Password changes cannot be synchronized with UC.
  4. My profile picture doesn't sync with UC Browser.

After some research, I found the following modification method:

Registration issues:

Find the following code in /addons/model/RegisterModel.class.php

If (filter_keyword($name) !== $name) { $this->_error = 'Sorry, this nickname contains sensitive words and is not allowed to be used'; return false; }

Add the following code below:

//uc //Load UC client SDK include_once SITE_PATH.'/api/uc_client/client.php'; if(!(uc_user_checkname($name)==1)){ $this->_error = 'The current username already exists'; return false; }

turn up:

public function isValidEmail($email, $oldEmail = null) {

Add the following code below:

turn up:

} elseif (!$this->_user_model->isChangeEmail($email, $this->_user_model->where('`email` LIKE ''.$oldEmail.''')->field('uid')->getField('uid'))) { $this->_error = 'This Email has been registered'; return false; }

Add the following code below:

else if (uc_user_checkemail($email) == 1) { $this->_error = 'This email address has already been registered'; return false; }

This resolves the UC issue when changing the username. However, UC synchronization doesn't occur after the change. You can temporarily disable username changes by making the following modifications:

Note: The following is a temporary solution and does not solve the problem at its root. I will investigate it further when I have time.

In /apps/public/Tpl/default/Account/index.html,
turn up:

Change to:

Background cache update
In /apps/public/Lib/Action/AccountAction.class.php
turn up:

$uname = t($_POST ['uname']); $oldName = t($_POST ['old_name']); $save ['uname'] = filter_keyword($uname); $res = model('Register')->isValidName($uname, $oldName); if (!$res) { $error = model('Register')->getLastError(); return $this->ajaxReturn(null, model('Register')->getLastError(), $res); }

Change to:

//$uname = t($_POST ['uname']); $oldName = t($_POST ['old_name']); $uname = $oldName; $save ['uname'] = filter_keyword($uname); //$res = model('Register')->isValidName($uname, $oldName); //if (!$res) { //$error = model('Register')->getLastError(); //return $this->ajaxReturn(null, model('Register')->getLastError(), $res); //}

In addition, email address modification should also be disabled:

In /apps/public/Tpl/default/Account/security.html,
delete:

Reset

Update cache

Password updates are also deleted, same as above.

This siteOriginal articleAll follow "Attribution-NonCommercial-ShareAlike 4.0 License (CC BY-NC-SA 4.0)Please retain the following annotations when sharing or adapting:

Original author:Jake Tao,source:"ThinkSNS registered username and email address and UC communication repair"

166
0 3 166

Further Reading

Post a reply

Log inYou can only comment after that.

Comment list (3 comments)

  • Alien
    Alien 2016-08-03 12:42

    Easy to use

  • hot in winter
    Winter heat 2016-08-03 11:18

    Thank you, blogger.

  • twenty two
    22 2016-08-03 11:17

    Works!

Share this page
Back to top