
Спасибо!
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
'deleteConfirmation' => tt('Are you sure you want to delete this user?'),
'buttons' => array(
'delete' => array(
'visible' => '$data->id != 1',
),
)
),
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
'deleteConfirmation' => tt('Are you sure you want to delete this user?'),
'buttons' => array(
'delete' => array(
'visible' => '$data->id != 1 && $data->id != NNN',
),
)
),
public function rules() {
return array(
array('price_from_rur, price_to_rur, num_of_rooms, title_ru', 'required'),
array('price_from_rur, price_to_rur, num_of_rooms, floor, floor_total,
square, window_to, type, price_type, obj_type_id, city_id', 'numerical', 'integerOnly' => true),
array('price_from_rur, price_to_rur, num_of_rooms', 'numerical', 'min' => 1),
array('berths, title_ru', 'length', 'max' => 255),
array('lat, lng', 'length', 'max' => 25),
array('id', 'safe', 'on' => 'search'),
array('floor', 'myFloorValidator'),
array('is_special_offer, is_free_from, is_free_to, active, address_ru, description_ru, description_near_ru, metroStations', 'safe'),
);
}
public function rules() {
return array(
array('num_of_rooms, title_ru', 'required'),
array('num_of_rooms, floor, floor_total,
square, window_to, type, price_type, obj_type_id, city_id', 'numerical', 'integerOnly' => true),
array('num_of_rooms', 'numerical', 'min' => 1),
array('berths, title_ru', 'length', 'max' => 255),
array('lat, lng', 'length', 'max' => 25),
array('id', 'safe', 'on' => 'search'),
array('floor', 'myFloorValidator'),
array('is_special_offer, is_free_from, is_free_to, active, address_ru, description_ru, description_near_ru, metroStations', 'safe'),
);
}
Xpycm писал(а):В простейшем случае это будет так:
1) Чтобы из обычного пользователя сделать админа выставьте isAdmin в значение 1 через phpmyadmin, таблицы prefix_users - http://clip2net.com/s/1Fsz9
2) Открываете файл protected\modules\users\views\backend\admin.php и замените
- Код: Выделить всё
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
'deleteConfirmation' => tt('Are you sure you want to delete this user?'),
'buttons' => array(
'delete' => array(
'visible' => '$data->id != 1',
),
)
),
на:,
- Код: Выделить всё
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
'deleteConfirmation' => tt('Are you sure you want to delete this user?'),
'buttons' => array(
'delete' => array(
'visible' => '$data->id != 1 && $data->id != NNN',
),
)
),
где NNN -ID пользователя, которому вы поставили isAdmin в значение 1.
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
'deleteConfirmation' => tt('Are you sure you want to delete this user?'),
),
),
));
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
'deleteConfirmation' => tt('Are you sure you want to delete this user?'),
),
),
));
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
'deleteConfirmation' => tt('Are you sure you want to delete this user?'),
'buttons' => array(
'delete' => array(
'visible' => '$data->id != 1 && $data->id != NNN',
),
)
),
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
'deleteConfirmation' => tt('Are you sure you want to delete this user?'),
'buttons' => array(
'delete' => array(
'visible' => '$data->id != 1 && $data->id != 2',
),
)
),
'visible' => '$data->id != 1 && $data->id != 2',
'visible' => '($data->id != 1 && $data->id != 2)',
Вернуться в Вопросы и помощь по изменениям
Сейчас этот форум просматривают: Google [Bot] и гости: 6