forked from oe5hpm/openBCM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alter.cpp
1813 lines (1747 loc) · 54 KB
/
alter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/***************************************************************
BayCom(R) Packet-Radio fuer IBM PC
OpenBCM-Mailbox
-----------------------------------------------
Einstellung der persoenlichen Benutzerparameter
-----------------------------------------------
Copyright (C) Florian Radlherr
Taubenbergstr. 32
83627 Warngau
Alle Rechte vorbehalten / All Rights reserved
***************************************************************/
//19980115 OE3DZW utcoffset -> ad_timezone
//19980118 OE3DZW sec in timestr
//19980215 OE3DZW text for userfwd with no path "passive" instead of
// "disabled"
//19980324 DH3MB support for md-pw
//19980329 OE3DZW changes to md-pw
//19980330 OE3DZW pwtype is reset to BayCom when pw is erased/set to off
//19980404 hrx support for guests
//19980408 OE3DZW "notvisible" was too long -> DO NOT TOUCH!!
//19980423 OE3DZW sfpwtype instead of fwdpwtype
// added newcall, get_newcall
//19980426 OE3DZW ttypw may be 8 chars long (was 7 only)
//19980427 OE3DZW pwline only when pw set, info when pw is set
//19980430 OE3DZW fixed readlock, could only be set to 0 or 1
//19980505 OE3DZW alter sfpwtype/loginpwtype will only show valid types
//19980506 OE3DZW fixes to fwdhold
//19980615 OE3DZW commented out newcall
//19980614 hrx added paclen to display_parameter, mbalter befnum/beftab
// and cases
//19980618 OE3DZW temp variable for fdelay short unsigned (warn. dos)
//19980619 OE3DZW typecast for short unsigned, removed check for < 0
//19980830 OE3DZW alter default only when password setting has not been
// switched off by user (alter pw off)
//19980830 OE3DZW name is only put to upper or lower case when all
// digits are in upper or lower case and there is no
// non-character in between.
// lastcmd - at top of pw-function
//19980914 OE3DZW guest excluded
//19980925 OE3DZW will not allow "." in userfwd-path
//19981015 OE3DZW md-pw-string was unterminated, fixed
//19981015 OE3DZW userpw off -> "disabled"
//19981015 OE3DZW ufwd can be set to "off" or "passive"
//19981016 OE3DZW changed text for ufwd (removed dot at end)
//19990220 DK2UI elseif instead of if (alter pw)
//19990227 DK2UI alter pw, fix
//19990227 OE3ZDW removed multiple mybbs-infos, fixed ufwd=0
//19990329 OE3DZW if userpw contains "DUMMY" http/pop3-logins are allowed
//19990412 OE3DZW mybbs update only if setting different/>1week
//19990812 DH3MB Removed trailing blank from "Password removed."-pwlog-entry
//19990823 DH3MB Added option "BINMODE"
//20000102 OE3DZW commented out BINMODE, not finished
//19991225 DF3VI blocked alter-options that cannot be J_TELL-ed
//20000414 DF3VI changed alter grep to alter ps
//20021210 hpk the user can set his paclen only within from the sysop given
// range (minpaclen, maxpaclen)
//20021213 hpk users settings only will be saved if his logintype is full
// (b->logintype==1) [CB-BCMNET login-concept]
//20021210 hpk is the user logged on as guest, settings will not be saved
//20030101 hpk if user queries information about own call he gets all infos
// in the CB-BCMNET Login-concept, user only gets full
// information about his call if he is not a guest; if user
// queries information about another call he gets limited infos
//20030104 hpk only if m.maxpaclen is 256, paclen can be disabled.
//20030105 hpk change in CB-BCMNET Login-concept:
// user-settings now will be saved, but some 'dangerous'
// commands like 'alter forward', etc. will not work.
//20030727 DB1RAS changes in paclen
#include "baycom.h"
static user_t us; // do not waste stack. The following functions
// no not need to be re-entrant
/*---------------------------------------------------------------------------*/
char *get_ttypw (char *call, char *pw)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1) && ! (us.status & 2))
strcpy(pw, us.ttypw);
else
*pw = 0;
return pw;
}
/*---------------------------------------------------------------------------*/
#ifdef __FLAT__
int put_ttypw (char *call, char *pw)
//****************************************************************************
//
// wird fuer httpaccount benoetigt
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, u, 1))
{
strcpy(u->ttypw, pw);
saveuser(u);
return 1;
}
else
return 0;
}
/*---------------------------------------------------------------------------*/
char *get_pw (char *call, char *pw)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1)
&& *us.name && ! (us.status & 2))
strcpy(pw, us.password);
else
*pw = 0;
return pw;
}
/*---------------------------------------------------------------------------*/
char *get_httppw (char *call, char *pw)
//****************************************************************************
//
//****************************************************************************
{
lastfunc("get_httppw");
strupr(call);
if (mbcallok(call)
&& loaduser(call, &us, 1) && *us.name && ! (us.status & 2)
&& (! *us.password || (*us.password == 1 && ! us.password[1])
|| strstr(us.password, "DUMMY")))
//do not allow login when password is set!
//but accept login when password contains "DUMMY"!
strcpy(pw, us.name);
else
*pw = 0;
return pw;
}
/*---------------------------------------------------------------------------*/
int get_smtp_security (char *call)
//****************************************************************************
//
//****************************************************************************
{
lastfunc("get_smtp_security");
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1))
return (us.unsecure_smtp & 1);
else return 0; // 0 => only secure smtp
}
#endif
/*---------------------------------------------------------------------------*/
int get_nopurge (char *call)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1))
return us.nopurge;
else return 0;
}
/*---------------------------------------------------------------------------*/
int get_fdelay (char *call)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1))
return (b->forwarding == fwd_none) * us.fdelay
+ (us.fhold * 60) * (! b->sysop) * (! b->usermail);
else return 0;
}
/*---------------------------------------------------------------------------*/
char *get_ufwd (char *call)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1))
return us.ufwd;
else return "";
}
/*---------------------------------------------------------------------------*/
time_t get_mybbstime (char *call)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1))
return us.mybbstime;
else return 0;
}
/*---------------------------------------------------------------------------*/
int get_readlock (char *call)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1))
return us.readlock;
else return 0;
}
/*---------------------------------------------------------------------------*/
void inc_mailgot (char *call)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1))
{
us.mailgot++;
saveuser(&us);
}
}
/*---------------------------------------------------------------------------*/
void inc_mailsent (char *call)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1))
{
us.mailsent++;
saveuser(&us);
}
}
/*---------------------------------------------------------------------------*/
int get_mybbs (char *call, char *bbs, int setmybbs)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (*call && mbcallok(call) && loaduser(call, &us, 1))
{
if (! bbs) return us.mybbsok; //null-pointer is given
if (! *bbs) strcpy(bbs, us.mybbs);
else if (setmybbs && (! *us.mybbs || (! us.mybbsok && setmybbs == 2)))
{
if (strlen(bbs) <= MYBBSLEN)
strcpy(us.mybbs, bbs);
else
strcpy(us.mybbs, atcall(bbs));
us.mybbsok = 0;
us.mybbstime = ad_time();
saveuser(&us);
}
return us.mybbsok;
}
return 0;
}
/*---------------------------------------------------------------------------*/
void set_name (char *call, char *name)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (*name && mbcallok(call) && loaduser(call, &us, 1))
{
if (! *us.name || ! us.nameok)
{
safe_strcpy(us.name, name);
saveuser(&us);
}
}
}
/*---------------------------------------------------------------------------*/
void set_qth (char *call, char *qth)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (*qth && mbcallok(call) && loaduser(call, &us, 1))
{
if (! *us.qth || ! us.qthok)
{
safe_strcpy(us.qth, qth);
saveuser(&us);
}
}
}
/*---------------------------------------------------------------------------*/
void set_zip (char *call, char *zip)
//****************************************************************************
//
//****************************************************************************
{
strupr(call);
if (*zip && mbcallok(call) && loaduser(call, &us, 1))
{
if (! *us.zip || ! us.zipok)
{
safe_strcpy(us.zip, zip);
saveuser(&us);
}
}
}
/*---------------------------------------------------------------------------*/
char *get_name (char *call, int par)
//****************************************************************************
//
//****************************************************************************
{
static char name[NAMELEN+5];
*name = 0;
strupr(call);
if (mbcallok(call) && loaduser(call, &us, 1) && *us.name)
{
if (par) sprintf(name, "(%s) ", us.name);
else sprintf(name, "%s ", us.name);
}
return name;
}
/*---------------------------------------------------------------------------*/
int get_usr_local (char *call, time_t &lastlogin)
//****************************************************************************
//
// returns 1 if a user is known and local, 0 else
// lastlogin: last login of user when found (else 0)
//
//****************************************************************************
{
strupr(call);
lastlogin = 0;
if (mbcallok(call) && loaduser(call, &us, 1) && us.mybbsok)
{
lastlogin = us.lastboxlogin;
if (! strcmp(m.boxname, atcall(us.mybbs))) return 1;
}
return 0;
}
/*---------------------------------------------------------------------------*/
int get_newcall (char *call, char *newcall)
//****************************************************************************
//
//
//****************************************************************************
{
char name[20];
strcpy(name, "get_newcall");
unsigned int i = 0;
if (strlen(call) > CALLEN) return 0;
strupr(call);
strcpy(newcall, call);
while (i < 20
&& mbcallok(newcall)
&& loaduser(newcall,&us,1)
&& *us.newcall)
{
i++;
us.newcall[CALLEN] = 0;
strcpy(newcall, us.newcall);
if (! strcmp(newcall, call))
{
trace(serious, name, "loop %s", call);
return 0;
}
}
if (i == 20 || i == 0)
{
strcpy(newcall, call);
return 0;
}
else
{
//trace(report, name, "upd %s -> %s", call, newcall);
return 1;
}
}
/*---------------------------------------------------------------------------*/
void set_mybbs (char *call, char *bbs, long btime, char *bid,
char *origin, short hops, char *w_name)
//****************************************************************************
//
// btime... 0 on user/sysop-input
// ... time-stamp of remote-msg
//
//****************************************************************************
{
char name[20];
time_t current = ad_time();
int isnew = 0;
strcpy(name, "set_mybbs");
hops++;
strupr(call);
if (! mbcallok(call))
{
trace(replog, name, "call %s", call);
return;
}
strupr(bbs);
if (mbhadrok(bbs) != 1)
{
trace(report, name, "hadr %s@%s", call, bbs);
return;
}
if (bid)
{
strupr(bid);
if (strlen(bid) > BIDLEN || strlen(bid) < 10)
{
trace(serious, name, "BID %s", bid);
return;
}
}
if (loaduser(call, &us, 1))
{
if (us.mybbstime > current) us.mybbstime = current;
if (btime > current) btime = current;
if (! btime || btime > us.mybbstime || ! us.mybbsok)
{
isnew = 1;
char bbs_call[CALLEN+1];
char usbbs_call[CALLEN+1];
safe_strcpy(bbs_call, atcall(bbs));
safe_strcpy(usbbs_call, atcall(us.mybbs));
//only send remote update if local setting is different and
//older than one week (no re-send within 1 week)
if ( btime //is remote msg
&& ! strcmp(bbs_call, usbbs_call)
&& (current - us.mybbstime) < (DAY * 7))
{
isnew = 0;
}
if ( btime //is remote msg
&& us.mybbsok //bbs was correct
&& ! strcmp(usbbs_call, m.boxname) //bbs was home-bbs before
&& strcmp(bbs_call, m.boxname)) //is now different from home-bbs
{
char sendcmd[LINELEN+1];
char content[255];
sprintf(sendcmd, "SP %s < %s Warning: MYBBS set to %s",
call, m.boxname, bbs_call);
sendcmd[LINELEN] = 0;
sprintf(content, "Your home-bbs was set to %s.\n"
"Origin: %s ID: %s Date: %s\n"
"\n"
"Please check if this is correct!\n",
bbs, origin, bid, datestr(btime, 2));
genmail(sendcmd, content);
if (strlen(us.password) > 3) // user has pw set
isnew = 0; //do not save/fwd that information
}
if (isnew)
//set data in user-database
{
if (btime) us.mybbstime = btime;
else us.mybbstime = current;
if (strlen(bbs) <= MYBBSLEN) strcpy(us.mybbs, bbs);
else strcpy(us.mybbs, atcall(bbs));
us.mybbsok = 1;
if (strcmp(atcall(bbs), m.boxname) && *us.ufwd > 1) *us.ufwd = 0;
// Active userfwd only if bbs is home-bbs
// User may set parameter to disabled/passive
saveuser(&us);
}
if (bid && isnew) //remote-update
{
wpdata_t *wp = (wpdata_t *) t_malloc(sizeof(wpdata_t), "wpa");
if (w_name)
strcpy(wp->name, w_name); //check for name received in WP/WPROT
else
{
if (! strcmp(b->logincall, origin) && *us.name && us.nameok)
{
//strncpy(wp->name, us.name, NAMELEN); //use local name
//wp->name[NAMELEN+1] = 0;
safe_strcpy(wp->name, us.name); //use local name
}
else
safe_strcpy(wp->name, "?"); //name is unknown
}
strcpy(wp->call, call);
strcpy(wp->bid, bid);
wp->mybbstime = us.mybbstime;
strcpy(wp->logincall, b->logincall);
strcpy(wp->origin, origin);
wp->hops = hops;
strcpy(wp->bbs, bbs);
if (us.zip) strcpy(wp->zip, us.zip);
else strcpy(wp->zip, "?");
if (us.qth) strcpy(wp->qth, us.qth);
else strcpy(wp->qth, "?");
#ifdef _GUEST
if (strcmp(wp->call, m.guestcall)) // guestcall nicht weiterreichen
#endif
addwp_m(wp);
t_free(wp);
}
}
}
}
/*---------------------------------------------------------------------------*/
static int near mybbs (char *adr, int weitergeben, time_t timeu)
//****************************************************************************
//
//****************************************************************************
{
char *bid;
char bbs[HADRESSLEN+1];
bid = NULL;
safe_strcpy(bbs, adr); //to be safe (db1ras)
if (weitergeben) subst1(bbs, '-', 0);
if (! weitergeben || mbhadrok(bbs) == 1)
{
if (weitergeben)
{
expand_hadr(bbs, m.hadrstore);
if (! strcmp(u->call, bbs)) return NO; // bbs=call only if hadr given..
bid = newbid();
}
set_mybbs(u->call, bbs, timeu, bid, b->logincall, 0, NULL);
loaduser(u->call, u, 0);
putf(ms(m_mybbsset), bbs);
if (bid) putf(ms(m_mybbsforward));
showpath(bbs, 0);
return OK;
}
return NO;
}
/*---------------------------------------------------------------------------*/
char *optstr (bitfeld option)
//****************************************************************************
//
//****************************************************************************
{
static char str[33];
unsigned int i, j = 0;
for (i = 0; i < 32; i++)
{
if (option & 1) str[j++] = i + 'A';
option >>= 1;
}
str[j] = 0;
return str;
}
/*---------------------------------------------------------------------------*/
void display_parameter (char *call, int full)
//****************************************************************************
//
//****************************************************************************
{
user_t uu;
char *z;
// char *z = ms(m_neverlogin);
strupr(call);
if (loaduser(call, &uu, 0))
{
if (! *uu.notvisible) uu.notvisible[1] = 0; // Vorsichtsmassnahme
putf(ms(m_a_headline), uu.call);
if (*uu.newcall || b->sysop)
putf("New callsign..(A NE).%s\n", *uu.newcall ? uu.newcall : "none");
putf(ms(m_a_mybbs), uu.mybbsok ? '@' : '?', uu.mybbs);
if (uu.mybbstime) putf(" (%s)", datestr(uu.mybbstime, 12));
putv(LF);
if (full)
{
putf(ms(m_a_reject), uu.notvisible+1);
putf(ms(m_a_prompt), uu.prompt);
putf(ms(m_a_firstcmd), uu.firstcmd);
putf(ms(m_a_name), uu.name);
putf("QTH...........(A QT).%s\n", uu.qth);
putf("ZIP-Code.......(A Z).%s\n", uu.zip);
putf(ms(m_a_speech), uu.sprache);
putf(ms(m_a_lines), uu.zeilen);
putf(ms(m_a_helplevel), uu.helplevel);
if (uu.lf == 6)
putf("Linefeeds..(A LF).-1\n");
else
putf(ms(m_a_linefeed), uu.lf);
putf(ms(m_a_idir), optstr(uu.opt[o_id]));
putf(ms(m_a_udir), optstr(uu.opt[o_ud]));
putf(ms(m_a_ilist), optstr(uu.opt[o_il]));
putf(ms(m_a_ulist), optstr(uu.opt[o_ul]));
putf(ms(m_a_iread), optstr(uu.opt[o_ir]));
putf(ms(m_a_uread), optstr(uu.opt[o_ur]));
putf(ms(m_a_check), optstr(uu.opt[o_ch]));
putf("PS-Options.(A PS).%s\n", optstr(uu.opt[o_ps]));
if (strcmp(b->logincall, call) == 0 || b->sysop)
{
putf("FHold.........(A FH).%-20d", uu.fhold);
putf("FWD-Delay..(A FD).%d min\n", uu.fdelay);
}
else
putf("FWD-Delay.....(A FD).%d min\n", uu.fdelay);
putf("User-Forward..(A UF).");
// userforward is either off, passive or passive and active
if (! *uu.ufwd) putf("passive\n");
else if (*uu.ufwd == 1) putf("off\n");
else putf("%s\n", uu.ufwd);
if (uu.dirformat) putf("Dirformat.....(A DI).%d\n", uu.dirformat);
#ifdef __FLAT__
if (uu.unsecure_smtp)
putf("Unsecure SMTP.(A UN).%d\n", (uu.unsecure_smtp & 1));
#endif
if ((m.paclen || b->sysop) && uu.paclen)
putf("Paclen........(A PA).%i\n", uu.paclen);
#ifdef _USERCOMP
if (uu.comp == 1)
putf("Comp........(A COMP).active\n");
else
putf("Comp........(A COMP).not active\n");
#endif
if (strcmp(b->logincall, call) == 0 || b->sysop)
{
putf("Status........(A ST).%-20d", uu.status);
putf("No-Purge...(A NO).%d\n", uu.nopurge);
putf("Passwordlen...(A PW).%-20d",
*uu.password == 1 ? -1 : (int) strlen(uu.password));
putf("TTYPWlen..(A TTY).%d\n", strlen(uu.ttypw));
#ifdef __LINUX__
if (*uu.linuxpw && m.addlinuxsystemuser)
putf("Linux-PWlen.(A LINU).%d\n", strlen(uu.linuxpw));
#endif
if (*uu.password > 1)
{
#ifdef FEATURE_MDPW
putf("Login-pwtype..(A LO).%-20s", pwtypestr (uu.loginpwtype));
putf("S&F-pwtype.(A SF).%s\n", pwtypestr (uu.sfpwtype));
#endif
putf("PW-Line......(A PWL).%d\n", uu.pwline);
}
putf("Readlock.....(A REA).%-20d", uu.readlock);
#ifdef FBBCHECKREAD
putf("FBBCheckmode (A FBB).%d\n", uu.fbbcheckmode);
#else
putf("\n");
#endif
}
putf("Binmode........(A B).");
switch (u->binmode)
{
#ifdef FEATURE_DIDADIT
case BINMODE_DIDADIT: putf("Didadit "); break;
#endif
#ifdef FEATURE_BINSPLIT
case BINMODE_BINSPLIT: putf("BinSplit"); break;
#endif
#ifdef FEATURE_YAPP
case BINMODE_YAPP: putf("Yapp "); break;
#endif
default: putf("AutoBIN ");
}
#ifdef __FLAT__
putf(" HTTP-Surface.........%d\n", uu.httpsurface);
#else
putf("\n");
#endif
putf("Away...........(A A).%-20d", uu.away);
if (uu.away == 1 && uu.awayendtime)
putf("Awayend.(A AWAYE).%s\n", datestr(uu.awayendtime, 2));
else
putf("\n");
if (uu.away == 1 && *uu.awaytext)
putf("Away Message: %s\n", uu.awaytext);
if (*uu.notification || b->sysop)
putf("Notification.(A NOT).%s\n",
*uu.notification ? uu.notification : "off");
//putf("RLimit........(A RL).%d\n", uu.rlimit);
}
else putf(ms(m_a_name2), uu.name);
if (uu.lastboxlogin)
{
if (uu.lastdirnews)
putf(ms(m_a_lastdirnew), datestr(uu.lastdirnews, 12));
if (uu.lastquit)
putf(ms(m_a_lastquit), datestr(uu.lastquit, 12));
z = datestr(uu.lastboxlogin, 12);
}
else
z = ms(m_neverlogin);
putf(ms(m_a_lastlogin), z);
if (*uu.uplink && uu.lastboxlogin) putf(" via %s", uu.uplink);
putv(LF);
putf(ms(m_a_loginmails), uu.logins, uu.mailgot, uu.mailread, uu.mailsent);
}
else
{
putf(ms(m_isunknown), call);
}
}
/*---------------------------------------------------------------------------*/
static void near changeoption (char *buf, int optgroup)
//****************************************************************************
//
//****************************************************************************
{
b->optminus = b->optplus = 0;
if (*buf)
{
if (strlen(buf) == 1 || strchr(buf, '-') || strchr(buf, '+'))
{
if (isalpha(*buf))
{
if (buf[1] == '-') b->optminus |= (1L << (*buf - 'A'));
else b->optplus |= (1L << (*buf - 'A'));
}
else if (*buf == '-') b->optminus |= (1L << (buf[1] - 'A'));
else if (*buf == '+') b->optplus |= (1L << (buf[1] - 'A'));
b->optminus = (~b->optminus);
u->opt[optgroup] = (u->opt[optgroup] & b->optminus) | b->optplus;
}
else
{
u->opt[optgroup] = 0;
while (*buf)
{
if (isalpha(*buf)) u->opt[optgroup] |= (1L << (*buf - 'A'));
buf++;
}
}
}
putf(ms(m_optionsfor), optstr(u->opt[optgroup]));
switch (optgroup)
{
case o_id: putf("Info-Dir"); break;
case o_ud: putf("User-Dir"); break;
case o_il: putf("Info-List"); break;
case o_ul: putf("User-List"); break;
case o_ir: putf("Info-Read"); break;
case o_ur: putf("User-Read"); break;
case o_ch: putf("Check"); break;
case o_ps: putf("PS"); break; //df3vi: A GREP ausgebaut
}
putf(ms(m_optionsset));
}
/*---------------------------------------------------------------------------*/
int mbalter (char *bef, char *selektor, char *call)
//****************************************************************************
//
//****************************************************************************
{
static char *beftab[]=
{ "COMMAND", "SPEECH", "FORWARD", "HELPLEVEL", "LINES", "DEFAULT",
"NAME", "PROMPT", "REJECT", "TTYPW", "PW", "LF", "UMLAUT",
"IDIR", "UDIR", "ILIST", "ULIST", "IREAD", "UREAD", "CHECK", "PS",
"STATUS", "QUOTA", "NOPURGE", "PWLINE", "READLOCK", "ECHO", "MYBBS",
"DELETE", "FDELAY", "FHOLD", "RLIMIT", "UFWD", "BINMODE", "PACLEN",
#ifdef __FLAT__
"UNSECURESMTP", "HTTPSURFACE",
#endif
#ifdef FBBCHECKREAD
"FBBCHECKMODE",
#endif
"LOGINPWTYPE", "SFPWTYPE", "NEWCALL", "DIRFORMAT", "AWAY", "QTH",
"ZIP", "AWAYENDTIME", "NOTIFICATION",
#ifdef __LINUX__
"LINUXPW",
#endif
#ifdef _USERCOMP
"COMP",
#endif
NULL
};
enum befnum
{ unsinn,
command, speech, forward, helplevel, lines, adefault,
name, prompt, reject, ttypw, pw, lf, umlaut,
idir, udir, ilist, ulist, iread, uread, check, ps,
status, quota, nopurge, pwline, readlock, echo, mybbs_,
delete_, fdelay, fhold, rlimit, ufwd, binmode,
paclen,
#ifdef __FLAT__
unsecuresmtp, httpsurface,
#endif
#ifdef FBBCHECKREAD
fbbcheckmode,
#endif
loginpwtype, sfpwtype, newcall, dirformat, away, qth,
zip, awayendtime, notification,
#ifdef __LINUX__
linuxpw,
#endif
#ifdef _USERCOMP
comp_
#endif
} cmd = unsinn;
static char funcname[] = "mbalter";
#ifdef _GUEST
if (! strcmp(b->logincall, m.guestcall))
{
putf(ms(m_notpossguest));
return 0;
}
#endif
int optgroup = 0;
int del_user_cache = 0;
if (! loaduser(call, u, 1)) return 0;
selektor += blkill(selektor);
if (! bef && ! *selektor)
{
display_parameter(call, 1);
return 1;
}
if (bef)
cmd = (befnum) readcmd(beftab, &bef, 0);
else
cmd = (befnum) readcmd(beftab, &selektor, 0);
//Negative lists
if (b->job == j_tell)
switch (cmd) //list of commands not available for "tell"
{
case command: case prompt: case newcall: case pw: case pwline:
case fhold: case rlimit: case readlock: case delete_: case helplevel:
case dirformat: case lf: case lines:
case adefault: case name: case reject: case ps: case check: case ulist:
case ilist: case idir: case udir: case iread: case uread: case status:
case nopurge: case ttypw: case ufwd: case loginpwtype: case sfpwtype:
case paclen: case away: case qth: case zip: case awayendtime:
case notification:
#ifdef __FLAT__
case httpsurface:
#endif
#ifdef __LINUX__
case linuxpw:
#endif
#ifdef _USERCOMP
case comp_:
#endif
#ifdef FBBCHECKREAD
case fbbcheckmode:
#endif
{
b->eingabefehler += 5;
putf(ms(m_alterunknown));
return 1;
}
default:
*selektor = 0; // do not allow parameters to be changed
break;
}
if (m.userpw >= 2 && ! b->pwok && ! b->sysop)
switch (cmd) // list of commands not available for "unpriv" users
{
case forward: case mybbs_: case newcall: case pw: case pwline:
case fhold: case rlimit: case readlock: case delete_:
case adefault: case ps: case check: case ulist: case ilist:
case idir: case udir: case iread: case uread: case status:
case nopurge: case ttypw: case ufwd: case loginpwtype: case sfpwtype:
case paclen: case away: case awayendtime:
case notification:
#ifdef __FLAT__
case httpsurface:
#endif
#ifdef __LINUX__
case linuxpw:
#endif
#ifdef _USERCOMP
case comp_:
#endif
#ifdef FBBCHECKREAD
case fbbcheckmode:
#endif
{
putf(ms(m_a_no_pw));
return 1;
}
default: *selektor = 0; //do not allow parameters to be changed
}
#ifdef _BCMNET_LOGIN
if (! b->logintype && ! b->sysop)
switch (cmd) //list of commands not available for guests
{
case name: case prompt: case command: case fdelay:
case forward: case mybbs_: case newcall: case pw: case pwline:
case fhold: case rlimit: case readlock: case delete_:
case adefault: case ps: case check: case ulist: case ilist:
case idir: case udir: case iread: case uread: case status:
case nopurge: case ttypw: case ufwd: case loginpwtype: case sfpwtype:
case paclen: case away: case qth: case zip: case awayendtime:
case notification:
#ifdef __FLAT__
case httpsurface:
#endif
#ifdef __LINUX__
case linuxpw:
#endif
#ifdef _USERCOMP
case comp_:
#endif
#ifdef FBBCHECKREAD
case fbbcheckmode:
#endif
{
putf(ms(m_a_no_pw));
return 1;
}
default: {}
}
#endif
switch (cmd)
{
case unsinn:
{
if (mbcallok(selektor) == 1)
display_parameter(selektor, 1);
else
putf(ms(m_alterunknown));
} break;
case forward:
case mybbs_:
{
char *cp;
cp = NULL;
time_t tmx = 0;
scanoptions(selektor);
selektor += blkill(selektor);
strupr(selektor);
cp = skip(selektor);
if (cp) tmx = atol(cp);
if (! *selektor || b->job == j_tell)
{ //df3vi: tell nur ohne argument
if (*u->mybbs) putf(ms(m_dispmybbs), u->mybbs);
else putf(ms(m_inputaddress));
}
else if (! mybbs(selektor, ! (b->optplus & o_l), tmx))
putf(ms(m_adrinvalid));
} break;
case command:
{
strupr(selektor);
if (strlen(selektor) > FIRSTCMDLEN)
putf(ms(m_cmdtoolong));
else
if (*selektor == 'Q')
putf(ms(m_commandquit));
else
{