• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

OpengateM Source Repository


Commit MetaInfo

Révisionfb687caf6f0d76fe4894b9d36d1797e492bc95f3 (tree)
l'heure2015-03-26 13:16:52
Auteurwatanaby <watanaby@user...>
Commiterwatanaby

Message de Log

modified update page. reduced emails.

Change Summary

Modification

--- a/doc/Changes.html
+++ b/doc/Changes.html
@@ -243,6 +243,10 @@ OpengateM History</H3>
243243 </DT><DD>
244244 Added sendreportmail.php cooperating with watch function of v0.9.1(phpsrc).
245245 </DD>
246+ <DT>Ver.0.9.4 at 2015.3.26
247+ </DT><DD>
248+ Modified update page(opengatemup). Reduced emails(opengatemmail).
249+ </DD>
246250 </DL>
247251
248252 </BODY>
--- a/html/en/macupdate.html
+++ b/html/en/macupdate.html
@@ -11,7 +11,12 @@ var loglist={
1111 </script>
1212 <script type="text/javascript" src="/opengate/showlog.js"></script>
1313 <script type="text/javascript" src="/opengate/editstring.js"></script>
14-</head>
14+<script>
15+function toggleDisplay(id){
16+ if (document.getElementById(id).style.display=="none") document.getElementById(id).style.display="block";
17+ else document.getElementById(id).style.display="none";
18+}
19+</script></head>
1520 <body align="center">
1621
1722 <p><font size="5">Update of MAC address registration </font></p>
@@ -38,34 +43,44 @@ action="%%CGINAME%%?lang=en&redirectedurl=%%REDIRECTEDURL%%">
3843 </tr>
3944 %%MACLIST%%
4045 </table>
41-<p><input type="submit" value=" Send "></p>
46+<p><input type="submit" value=" Send ">
47+<span style="color:blue;text-decoration:underline;" onclick="toggleDisplay('help1')"> help </span>
48+</p>
4249 </form>
50+
4351 <p><font color="red">
4452 %%ERRORLIST%%
4553 </font></p>
46-<p>
47-<p><strong>To prevent hijacking, please confirm your usage
48-log.</strong>
49-The red border cells in the usage log include two or more records for one device. Please check carefully.
50-</p>
5154
52-<p>Select <strong>Renew</strong> to renew the registration (resume
55+<ul id="help1" style="display:none">
56+<li>Select <strong>Renew</strong> to renew the registration (resume
5357 and extend the limit date).
54-</p>
55-<p>
58+</li>
59+<li>
5660 Select <strong>Pause</strong> to pause the
5761 usage. If you want to reuse the device, check "Renew".
58-</p>
59-<p>
62+</li>
63+<li>
6064 Select <strong>Delete</strong> to delete the registration. If you
6165 may use this terminal in the future, please use "Pause".
62-</p>
63-<p>
66+</li>
67+<li>
6468 The status "I" indicates that the device is set as Inactive by some
6569 reason. Please contact to the administrator.
70+</li>
71+</ul>
72+
73+<p><font size="5"> usage log </font><font size="3">(To prevent hijacking, please confirm your log.)</font>
74+<span style="color:blue;text-decoration:underline;" onclick="toggleDisplay('help2')"> help </span>
6675 </p>
6776
68-<p><font size="5"> usage log </font></p>
77+<ul id="help2" style="display:none">
78+<li>The color-bars in the chart show the time range when you used your devices.</li>
79+<li>If there is a use without your memory, please inform it to the administrator.</li>
80+<li>The red frame indicates that one device has plural logs. Please check it carefully.</li>
81+<li>Even if you do not intend to use the device, the automatic access might be done.</li>
82+<li>The closing of the network has time delay after finishing the use.</li>
83+</ul>
6984
7085 <div id="usagelog"></div>
7186 <div id="popup"></div>
--- a/html/ja/macupdate.html
+++ b/html/ja/macupdate.html
@@ -11,6 +11,12 @@ var loglist={
1111 </script>
1212 <script type="text/javascript" src="/opengate/showlog.js"></script>
1313 <script type="text/javascript" src="/opengate/editstring.js"></script>
14+<script>
15+function toggleDisplay(id){
16+ if (document.getElementById(id).style.display=="none") document.getElementById(id).style.display="block";
17+ else document.getElementById(id).style.display="none";
18+}
19+</script>
1420 </head>
1521 <body align="center">
1622 <p><font size="5">MACアドレス登録更新</font></p>
@@ -38,27 +44,30 @@ action="%%CGINAME%%?lang=ja&redirectedurl=%%REDIRECTEDURL%%">
3844 %%MACLIST%%
3945 </table>
4046
41-<p><input type="submit" value=" 送信 "></p>
47+<p><input type="submit" value=" 送信 ">
48+<span style="color:blue;text-decoration:underline;" onclick="toggleDisplay('help1')"> help </span>
49+</p>
4250 </form>
4351
4452 <p><font color="red">
4553 %%ERRORLIST%%
4654 </font></p>
4755
48-<p><strong>不正利用を防ぐため、下の利用履歴が妥当か確認して下さい。
49-</strong>利用履歴における赤枠セルは1つの機器に対する2つ以上の利用記録を含んでいます。特に注意して下さい。</p>
50-
51-<p><strong>「更新」</strong>をチェックすると、機器の登録を更新して利用期限を延長します。</p>
56+<ul id="help1" style="display:none">
57+<li><strong>「更新」</strong>をチェックすると、機器の登録を更新して利用期限を延長します。</li>
58+<li><strong>「休止」</strong>をチェックすると、利用不可にします。再び利用するときには更新処理をしてください。</li>
59+<li><strong>「削除」</strong>をチェックすると、機器の登録を削除します。再び利用する可能性があるときは、休止を利用下さい。</li>
60+<li>状態が"I"となっている機器は無効とされています。理由は管理者に問い合わせ下さい。</li>
61+</ul>
5262
53-<p><strong>「休止」</strong>をチェックすると、利用不可にします。再び利用するときには更新処理をしてください。
63+<p><font size="5">利用履歴</font><font size="3">(不正利用を防ぐため、妥当か確認して下さい。)</font>
64+<span style="color:blue;text-decoration:underline;" onclick="toggleDisplay('help2')"> help </span>
5465 </p>
55-<p><strong>「削除」</strong>をチェックすると、機器の登録を削除します。
56-再び利用する可能性があるときは、休止を利用下さい。
57-</p>
58-<p>状態が"I"となっている機器は無効とされています。理由は管理者に問い合わせ下さい。</p>
59-
60-
61-<p><font size="5">利用履歴</font></p>
66+<ul id="help2" style="display:none">
67+<li>利用された時間帯を1時間ごとに色付け表示しています。覚えの無い履歴があれば管理者までお知らせください。</li>
68+<li>赤枠の時間帯は1つの機器に対する2つ以上の履歴を含んでいます。特に注意下さい。</li>
69+<li>意図して利用しなくても、自動通信による利用がありえます。また使い終わってしばらくしてから閉鎖します。</li>
70+</ul>
6271
6372 <div id="usagelog"></div>
6473 <div id="popup"></div>
--- a/html/showlog.js
+++ b/html/showlog.js
@@ -168,13 +168,13 @@ function setupCellProperties(td, date, time, iDevice){
168168 //set background color of the cell
169169 //if two or more items are found, display red border
170170 if(logItemNo.length > 1){
171- td.style.background=colorList[iDevice];
171+ td.style.background=colorList[iDevice%5];
172172 td.style.border="3px solid Red";
173173 }
174174 // one item is found (if the item number == -1, no log is matched)
175175 else if(logItemNo.length == 1){
176176 if(logItemNo[0] == -1) td.style.background=colorList["none"];
177- else td.style.background=colorList[iDevice];
177+ else td.style.background=colorList[iDevice%5];
178178 }
179179 // no item
180180 else td.style.background=colorList["blank"];
@@ -239,7 +239,7 @@ function makeDevicesLegend() {
239239 tr.appendChild(td);
240240 var td = document.createElement("td");
241241 td.width=50;
242- td.style.background=colorList[iDevice];
242+ td.style.background=colorList[iDevice%5];
243243 tr.appendChild(td);
244244 tbody.appendChild(tr);
245245 }
--- a/mngsrc/managementdb.c
+++ b/mngsrc/managementdb.c
@@ -574,10 +574,11 @@ int getNextMailAddressFromMngDb(char* mailAddress, char* limitDate, char* device
574574 /* [select mailAddress,limitDate,device from macaddrs
575575 where ( date(now())=date(adddate(limitDate, interval -1 day))
576576 OR date(now())=date(adddate(limitDate, interval -7 day)) )
577- AND (status='A' OR status='P')] */
577+ AND (status='A' OR status='P') order by mailAddress,limitDate] */
578578 snprintf(queryStr, BUFFMAXLN,
579579 "select mailAddress,limitDate,device from macaddrs "
580- " where (%s) and (status='A' or status='P')", mailTiming);
580+ " where (%s) and (status='A' or status='P') "
581+ " order by mailAddress,limitDate", mailTiming);
581582 /* mailTiming is a condition string defined in conf file */
582583
583584 /* send SQL query */
--- a/mngsrc/opengatemmail.c
+++ b/mngsrc/opengatemmail.c
@@ -29,9 +29,12 @@ Email: watanaby@is.saga-u.ac.jp
2929 /***************************************************/
3030 int main(int argc, char **argv)
3131 {
32- char mailAddress[BUFFMAXLN]; /* mail address */
33- char limitDate[WORDMAXLN]; /* limit date */
34- char device[WORDMAXLN]; /* device name */
32+ char mailAddress[BUFFMAXLN]=""; /* mail address */
33+ char limitDate[WORDMAXLN]=""; /* limit date */
34+ char device[WORDMAXLN]=""; /* device name */
35+ char deviceList[BUFFMAXLN]=""; /* device name list */
36+ char mailAddressPrev[BUFFMAXLN]=""; /* mail address of previous record */
37+ char limitDatePrev[WORDMAXLN]=""; /* limit date of previous record */
3538 int count=0; /* count for sending mails */
3639 char* progName; /* the name of this program in argv[0] */
3740
@@ -67,9 +70,51 @@ int main(int argc, char **argv)
6770 InitConf();
6871 if(!InitMngDb()) return 0;
6972
70- /* get mail address for users near expiration date and send mail */
71- while(GetNextMailAddressFromMngDb(mailAddress, limitDate, device)){
72- if(SendMail(mailAddress, limitDate, device)) count++;
73+ /* get first mail address near expiration date */
74+ if(GetNextMailAddressFromMngDb(mailAddress, limitDate, device)){
75+
76+ /* if get, save the first record */
77+ strncpy(mailAddressPrev, mailAddress, BUFFMAXLN);
78+ strncpy(limitDatePrev, limitDate, WORDMAXLN);
79+ strncpy(deviceList, device, WORDMAXLN);
80+
81+ /* get next mail address near expiration date */
82+ while(GetNextMailAddressFromMngDb(mailAddress, limitDate, device)){
83+
84+ /* if mailAddress or limitDate are not same as previous */
85+ if( strcmp(mailAddress, mailAddressPrev)!=0
86+ || strcmp(limitDate, limitDatePrev)!=0 ){
87+
88+ /* send mail to the address and clear deviceList */
89+ if(!isNull(mailAddressPrev)){
90+ if(SendMail(mailAddressPrev, limitDatePrev, deviceList)) count++;
91+ }
92+ deviceList[0]='\0';
93+ }
94+
95+ /* save the mail Address and limit date */
96+ strncpy(mailAddressPrev, mailAddress, BUFFMAXLN);
97+ strncpy(limitDatePrev, limitDate, WORDMAXLN);
98+
99+ /* add the device name to the deviceList
100+ if list is too long, it is terminated by ", ......" */
101+ if(isNull(deviceList)){
102+ strncpy(deviceList, device, WORDMAXLN);
103+ }
104+ else if(strstr(deviceList, ", ......")!=NULL) ;
105+ else if( strlen(deviceList) > BUFFMAXLN*0.8 ){
106+ strncat(deviceList, ", ......", BUFFMAXLN);
107+ }
108+ else{
109+ strncat(deviceList, ", ", BUFFMAXLN);
110+ strncat(deviceList, device, BUFFMAXLN);
111+ }
112+ }
113+
114+ /* post process at the end of get loop */
115+ if( !isNull(mailAddressPrev) ){
116+ if(SendMail(mailAddressPrev, limitDatePrev, deviceList)) count++;
117+ }
73118 }
74119
75120 /* finalize */