rtrt 59 Posted 2009-10-26 08:56:12 Share Posted 2009-10-26 08:56:12 Можно ли сделать автоматичесую отсылку сообщения пользователю при смене тарифа? Допустим есть тарифы А и В. Пользователь был на тарифе В. Я ему меняю тариф на А и при этом пользователю автоматически отсылается сообщение "Мол вы переведены на тариф А" Link to post Share on other sites
trinux 3 Posted 2009-10-26 09:04:26 Share Posted 2009-10-26 09:04:26 Вытаскиваем из OnChange $newValue и шлем сообщение. Link to post Share on other sites
rtrt 59 Posted 2009-10-26 09:14:30 Author Share Posted 2009-10-26 09:14:30 пример можно? Link to post Share on other sites
trinux 3 Posted 2009-10-26 09:33:15 Share Posted 2009-10-26 09:33:15 побаловался щас, с кодировкой нужно что-то делать, ну или ключ какой-то в кк. Но смысл я думаю будет понятен. /etc/stargazer/OnChange #!/bin/bash login=$1 param=$2 oldValue=$3 newValue=$4 #message /usr/sbin/sgconf set -s 127.0.0.1 -p 5555 -a admin -w пароль_админа -u $login -m new-tarif:$newValue echo "User: '$login'. Parameter $param changed from '$oldValue' to '$newValue'" >> /var/stargazer/users.chg.log Link to post Share on other sites
trinux 3 Posted 2009-10-26 09:38:10 Share Posted 2009-10-26 09:38:10 только нужно чтоб другое не передавалось, только тариф. а то когда что-то меняем, то этот параметр будет передаваться пользователю. тут можно думаю поколдавать Link to post Share on other sites
rtrt 59 Posted 2009-10-26 09:39:04 Author Share Posted 2009-10-26 09:39:04 я так понял это через КК? а через виндовый конфигуратор можно реализовать? Link to post Share on other sites
trinux 3 Posted 2009-10-26 09:42:05 Share Posted 2009-10-26 09:42:05 Через виндовый нет. хотя если перепишут его стукни в аську. 32518один Link to post Share on other sites
trinux 3 Posted 2009-10-26 09:52:08 Share Posted 2009-10-26 09:52:08 вот так #message if [ "$param" = "tariff" ]; then /usr/sbin/sgconf set -s 127.0.0.1 -p 5555 -a admin -w пароль -u $login -m new-tarif:$newValue fi Link to post Share on other sites
rtrt 59 Posted 2009-10-26 10:12:10 Author Share Posted 2009-10-26 10:12:10 Мне бы желательно под виндовый... Link to post Share on other sites
trinux 3 Posted 2009-10-26 10:14:19 Share Posted 2009-10-26 10:14:19 а в чем разница? не понимаю вот это вставляется в /etc/stargazer/onchange и при смене тарифа приходит сообщение о новом тарифном плане. Link to post Share on other sites
rtrt 59 Posted 2009-10-26 14:49:08 Author Share Posted 2009-10-26 14:49:08 Ладно... подниму тестовый сервер буду пробывать! )) Link to post Share on other sites
rtrt 59 Posted 2009-10-29 09:24:36 Author Share Posted 2009-10-29 09:24:36 вот так #message if [ "$param" = "tariff" ]; then /usr/sbin/sgconf set -s 127.0.0.1 -p 5555 -a admin -w пароль -u $login -m new-tarif:$newValue fi что-то ничего не происходит при смене тарифа... Link to post Share on other sites
trinux 3 Posted 2009-10-29 15:18:47 Share Posted 2009-10-29 15:18:47 а ручками отправить сообщение удается? порт,пароль? попробуйте отправить что-то типо 123 Link to post Share on other sites
rtrt 59 Posted 2009-10-30 10:46:53 Author Share Posted 2009-10-30 10:46:53 Да, ручками отправляется Link to post Share on other sites
trinux 3 Posted 2009-10-30 10:48:02 Share Posted 2009-10-30 10:48:02 пермиссии на OnChange ? Покажите его полностью сюда. Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now