Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/citrix/storefront.control.class.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2569 by niro, Thu Sep 17 10:12:41 2015 UTC revision 2642 by niro, Thu Oct 8 10:23:56 2015 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3  push_config storefront10_store storefront20_session  #push_config 70_storefront_store 80_storefront_session
4    push_config 80_storefront_session
5    
6  help_storefront_store()  help_storefront_store()
7  {  {
# Line 20  set_storefront_session() Line 21  set_storefront_session()
21   local action="${CLASS_ARGV[1]}"   local action="${CLASS_ARGV[1]}"
22   local name="${CLASS_ARGV[2]}"   local name="${CLASS_ARGV[2]}"
23   local session="${CLASS_ARGV[3]}"   local session="${CLASS_ARGV[3]}"
24   local user="${CLASS_ARGV[4]}"   local store="${CLASS_ARGV[4]}"
25   local domain="${CLASS_ARGV[5]}"   local user="${CLASS_ARGV[5]}"
26   local password="${CLASS_ARGV[6]}"   local domain="${CLASS_ARGV[6]}"
27     local password="${CLASS_ARGV[7]}"
28     local autostart="${CLASS_ARGV[8]}"
29   local id   local id
30   local enabled   local enabled
31    
# Line 41  set_storefront_session() Line 44  set_storefront_session()
44   return 1   return 1
45   fi   fi
46    
47     [[ -z ${autostart} ]] && autostart=0
48    
49   id=$(mysqldo "select id from cfg_sessions_storefront where serial='${serial}' and name='${name}';")   id=$(mysqldo "select id from cfg_sessions_storefront where serial='${serial}' and name='${name}';")
50   if [[ -n ${id} ]]   if [[ -n ${id} ]]
51   then   then
52   mysqldo "update cfg_sessions_storefront set name='${name}', session='${session}', filename='${filename}', username='${username}', domain='${domain}', password='${password}', store='${store}', enabled='${enabled}' where id=${id};"   mysqldo "update cfg_sessions_storefront set name='${name}', session='${session}', filename='${filename}', username='${username}', domain='${domain}', password='${password}', store='${store}', autostart='${autostart}', enabled='${enabled}' where id=${id};"
53   else   else
54   mysqldo "insert into cfg_fluxbox_menuitem(serial, name, session, filename, username, domain, password, store, enabled) values('${serial}', '${name}', '${session}', '${filename}', '${domain}', '${password}', '${store}', '${enabled}');"   mysqldo "insert into cfg_sessions_storefront(serial, name, session, filename, username, domain, password, store, autostart, enabled) values('${serial}', '${name}', '${session}', ${store}', '${filename}', '${domain}', '${password}', '${store}', '${autostart}', '${enabled}');"
55   fi   fi
56  }  }
57    
58  control_storefront_session()  control_storefront_session()
59  {  {
60   local serial="${CLASS_ARGV[0]}"   local serial="${CLASS_ARGV[0]}"
61   push_config_storefront20_session "${serial}"   push_config_80_storefront_session "${serial}"
62  }  }
63    
64  push_config_storefront20_session()  push_config_80_storefront_session()
65  {  {
66   local serial="$1"   local serial="$1"
67   local values   local values
# Line 66  push_config_storefront20_session() Line 71  push_config_storefront20_session()
71   for id in ${values}   for id in ${values}
72   do   do
73   evaluate_table_xml cfg_sessions_storefront "where serial='${serial}'"   evaluate_table_xml cfg_sessions_storefront "where serial='${serial}'"
74   if [[ -z ${cfg_sessions_storefront_name} ]]   if [[ -z ${cfg_sessions_storefront_session} ]]
75   then   then
76   eecho "Name must not be empty id->'${id}'"   eecho "Session must not be empty id->'${id}'"
77   continue   continue
78   fi   fi
79   if [[ -z ${cfg_sessions_storefront_enabled} ]]   if [[ -z ${cfg_sessions_storefront_enabled} ]]
# Line 78  push_config_storefront20_session() Line 83  push_config_storefront20_session()
83   fi   fi
84   if [[ ${cfg_sessions_storefront_enabled} = 1 ]]   if [[ ${cfg_sessions_storefront_enabled} = 1 ]]
85   then   then
86   control_client "${serial}" set storefront.session add "${cfg_sessions_storefront_name}" "${cfg_sessions_storefront_session}" "${cfg_sessions_storefront_username}" "${cfg_sessions_storefront_domain} ${cfg_sessions_storefront_password}"   control_client "${serial}" set storefront.session add "${cfg_sessions_storefront_name}" "${cfg_sessions_storefront_session}" "${cfg_sessions_storefront_store}" "${cfg_sessions_storefront_username}" "${cfg_sessions_storefront_domain}" "${cfg_sessions_storefront_password}" "${cfg_sessions_storefront_autostart}"
87   elif [[ ${cfg_sessions_storefront_enabled} = 0 ]]   elif [[ ${cfg_sessions_storefront_enabled} = 0 ]]
88   then   then
89   control_client "${serial}" set storefront.session del "${cfg_sessions_storefront_name}"   control_client "${serial}" set storefront.session del "${cfg_sessions_storefront_name}"
# Line 119  set_storefront_store() Line 124  set_storefront_store()
124   then   then
125   mysqldo "update cfg_storefront_store set store='${store}', enabled='${enabled}' where id=${id};"   mysqldo "update cfg_storefront_store set store='${store}', enabled='${enabled}' where id=${id};"
126   else   else
127   mysqldo "insert into cfg_fluxbox_menuitem(serial, store, enabled) values('${serial}', '${store}', '${enabled}');"   mysqldo "insert into cfg_storefront_store(serial, store, enabled) values('${serial}', '${store}', '${enabled}');"
128   fi   fi
129  }  }
130    
131  control_storefront_store()  control_storefront_store()
132  {  {
133   local serial="${CLASS_ARGV[0]}"   local serial="${CLASS_ARGV[0]}"
134   push_config_storefront10_store "${serial}"   push_config_70_storefront_store "${serial}"
135  }  }
136    
137  push_config_storefront10_store()  push_config_70_storefront_store()
138  {  {
139   local serial="$1"   local serial="$1"
140   local values   local values

Legend:
Removed from v.2569  
changed lines
  Added in v.2642