нашел функцию, которая отвечает за редактирование профиля пользователя ... тут надо добавить условие, при котором профиль блокировался когда пользователь нажимает кнопку обновить профиль
PHP:
function edit($userId)
{
$input = $this->prepareData(false);
// hook pre add or edit
osc_run_hook('pre_user_post');
$flash_error = '';
$error = array();
if($this->is_admin) {
$user_email = $this->manager->findByEmail($input['s_email']);
if(isset($user_email['pk_i_id']) && $user_email['pk_i_id']!=$userId) {
$flash_error .= sprintf(_m('The specified e-mail is already used by %s') , $user_email['s_username']) . PHP_EOL;
$error[] = 3;
}
}
if($input['s_name']=='') {
$flash_error .= _m('The name cannot be empty').PHP_EOL;
$error[] = 10;
}
if($this->is_admin){
if( Params::getParam('s_password', false, false) != Params::getParam('s_password2', false, false) ) {
$flash_error .= _m("Passwords don't match") . PHP_EOL;
$error[] = 7;
}
}
$flash_error = osc_apply_filter('user_edit_flash_error', $flash_error, $userId);
if($flash_error!='') {
return $flash_error;
}
$this->manager->update($input, array('pk_i_id' => $userId));
if($this->is_admin) {
Item::newInstance()->update( array('s_contact_name' => $input['s_name'], 's_contact_email' => $input['s_email']), array('fk_i_user_id' => $userId) );
ItemComment::newInstance()->update( array('s_author_name' => $input['s_name'], 's_author_email' => $input['s_email']), array('fk_i_user_id' => $userId) );
Alerts::newInstance()->update( array('s_email' => $input['s_email']), array('fk_i_user_id' => $userId) );
Log::newInstance()->insertLog( 'user', 'edit', $userId, $input['s_email'], $this->is_admin ? 'admin' : 'user', $this->is_admin ? osc_logged_admin_id() : osc_logged_user_id() );
} else {
Item::newInstance()->update( array('s_contact_name' => $input['s_name']), array('fk_i_user_id' => $userId) );
ItemComment::newInstance()->update( array('s_author_name' => $input['s_name']), array('fk_i_user_id' => $userId) );
$user = $this->manager->findByPrimaryKey($userId);
Log::newInstance()->insertLog('user', 'edit', $userId, $user['s_email'], $this->is_admin ? 'admin' : 'user', $this->is_admin ? osc_logged_admin_id() : osc_logged_user_id() );
}
if(!$this->is_admin) {
Session::newInstance()->_set('userName', $input['s_name']);
$phone = ($input['s_phone_mobile'])? $input['s_phone_mobile'] : $input['s_phone_land'];
Session::newInstance()->_set('userPhone', $phone);
}
if ( is_array( Params::getParam('s_info') ) ) {
foreach (Params::getParam('s_info') as $key => $value) {
$this->manager->updateDescription($userId, $key, $value);
}
}
osc_run_hook('user_edit_completed', $userId);
if ( $this->is_admin ) {
$iUpdated = 0;
if( (Params::getParam("b_enabled") != '') && (Params::getParam("b_enabled") == 1 ) ) {
$iUpdated += $this->manager->update( array('b_enabled' => 1), array('pk_i_id' => $userId) );
} else {
$iUpdated += $this->manager->update( array('b_enabled' => 0), array('pk_i_id' => $userId) );
}
if( (Params::getParam("b_active") != '') && (Params::getParam("b_active") == 1) ) {
$iUpdated += $this->manager->update( array('b_active' => 1), array('pk_i_id' => $userId) );
} else {
$iUpdated += $this->manager->update( array('b_active' => 0), array('pk_i_id' => $userId) );
}
if($iUpdated > 0) {
return 2;
}
}
return 1;
}