Module: Yast::SquidStoreDelInclude

Defined in:
../../src/include/squid/store_del.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) DelFromACLGroupsTable(id_item)

Delete ACL with id id_item. If ACL has only one occurrence (one definition line) in config file and ACL is used by any option (http_access, no_cache …) than user is asked if he really want to delete the ACL. If option 'http_access' uses this ACL than it's unaccepted to delete the ACL.



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
# File '../../src/include/squid/store_del.rb', line 503

def DelFromACLGroupsTable(id_item)
  ok = true

  if Squid.NumACLs(id_item) == 1
    affected_options = Squid.ACLIsUsedBy(id_item)
    if Ops.greater_than(Builtins.size(affected_options), 0)
      ok = false

      if Builtins.contains(affected_options, "http_access")
        #Report::Error( _("This ACL Group can't be deleted.\nIt's used in Access Control table."));
        Report.Error(
          _(
            "You must not delete this ACL Group, because \nit is used in the Access Control table.\n"
          ) +
            _(
              "If you want to change name of this ACL Group you must\ndelete all of its occurrences in Access Control table."
            )
        )
      else
        message = Ops.add(
          Ops.add(
            _(
              "If you delete this ACL Group, these options might be affected: \n"
            ) + "    ",
            Builtins.mergestring(affected_options, ",\n    ")
          ),
          ".\n"
        ) # +
        #_("Are you sure you want to delete this ACL Group?");
        if Report.AnyQuestion(
            Label.WarningMsg,
            message,
            _("Delete anyway"), #Label::YesButton(),
            _("Do not delete"), #Label::NoButton(),
            :focus_no
          )
          ok = true
        end
      end
    end
  end

  if ok
    Squid.DelACL(id_item)
    if Ops.greater_or_equal(id_item, Builtins.size(Squid.GetACLs))
      id_item = Ops.subtract(id_item, 1)
    end
  end

  id_item
end

- (Object) DelFromHttpAccessTable(id_item)



356
357
358
359
360
361
362
# File '../../src/include/squid/store_del.rb', line 356

def DelFromHttpAccessTable(id_item)
  Squid.DelHttpAccess(id_item)
  if Ops.greater_or_equal(id_item, Builtins.size(Squid.GetHttpAccesses))
    id_item = Ops.subtract(id_item, 1)
  end
  id_item
end

- (Object) DelFromHttpPortsTable(id_item)



93
94
95
96
97
98
99
# File '../../src/include/squid/store_del.rb', line 93

def DelFromHttpPortsTable(id_item)
  Squid.DelHttpPort(id_item)
  if Ops.greater_or_equal(id_item, Builtins.size(Squid.GetHttpPorts))
    id_item = Ops.subtract(id_item, 1)
  end
  id_item
end

- (Object) DelFromRefreshPatternsTable(id_item)



136
137
138
139
140
141
142
# File '../../src/include/squid/store_del.rb', line 136

def DelFromRefreshPatternsTable(id_item)
  Squid.DelRefreshPattern(id_item)
  if Ops.greater_or_equal(id_item, Builtins.size(Squid.GetRefreshPatterns))
    id_item = Ops.subtract(id_item, 1)
  end
  id_item
end

- (Object) initialize_squid_store_del(include_target)



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File '../../src/include/squid/store_del.rb', line 30

def initialize_squid_store_del(include_target)
  Yast.import "UI"

  textdomain "squid"

  Yast.import "Label"
  Yast.import "Report"
  Yast.import "FileUtils"
  Yast.import "Popup"
  Yast.import "Mode"

  Yast.import "Squid"
  Yast.import "SquidACL"
  Yast.import "SquidErrorMessages"

  Yast.include include_target, "squid/helper_functions.rb"
end

- (Object) MoveDownHttpAccess(id_item)



372
373
374
375
376
377
378
379
380
381
382
383
# File '../../src/include/squid/store_del.rb', line 372

def MoveDownHttpAccess(id_item)
  ret = nil

  if Ops.less_than(
      id_item,
      Ops.subtract(Builtins.size(Squid.GetHttpAccesses), 1)
    )
    Squid.MoveHttpAccess(id_item, Ops.add(id_item, 1))
    ret = Ops.add(id_item, 1)
  end
  ret
end

- (Object) MoveDownRefreshPattern(id_item)

returns new position or nil if not moved



155
156
157
158
159
160
161
162
163
164
165
166
# File '../../src/include/squid/store_del.rb', line 155

def MoveDownRefreshPattern(id_item)
  ret = nil

  if Ops.less_than(
      id_item,
      Ops.subtract(Builtins.size(Squid.GetRefreshPatterns), 1)
    )
    Squid.MoveRefreshPattern(id_item, Ops.add(id_item, 1))
    ret = Ops.add(id_item, 1)
  end
  ret
end

- (Object) MoveUpHttpAccess(id_item)



363
364
365
366
367
368
369
370
371
# File '../../src/include/squid/store_del.rb', line 363

def MoveUpHttpAccess(id_item)
  ret = nil

  if Ops.greater_than(id_item, 0)
    Squid.MoveHttpAccess(id_item, Ops.subtract(id_item, 1))
    ret = Ops.subtract(id_item, 1)
  end
  ret
end

- (Object) MoveUpRefreshPattern(id_item)

returns new position or nil if not moved



145
146
147
148
149
150
151
152
153
# File '../../src/include/squid/store_del.rb', line 145

def MoveUpRefreshPattern(id_item)
  ret = nil

  if Ops.greater_than(id_item, 0)
    Squid.MoveRefreshPattern(id_item, Ops.subtract(id_item, 1))
    ret = Ops.subtract(id_item, 1)
  end
  ret
end

- (Object) StoreDataFromAddEditACLDialog(id_item)

************* ACL ****************************



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
# File '../../src/include/squid/store_del.rb', line 389

def StoreDataFromAddEditACLDialog(id_item)
  ok = true

  type = Convert.to_string(UI.QueryWidget(Id("type"), :Value))
  name = Convert.to_string(UI.QueryWidget(Id("name"), :Value))
  options = SquidACL.GetOptions(type)

  verification = SquidACL.Verify(type)

  affected_options = []
  num_acls = nil
  old_name = nil
  if id_item != nil
    affected_options = Squid.ACLIsUsedBy(id_item)
    num_acls = Squid.NumACLs(id_item)
    old_name = Ops.get_string(Squid.GetACL(id_item), "name", "")
  end

  if verification && Ops.greater_than(Builtins.size(name), 0)
    # test, if exists ACL with same name but different type
    existed_type = Squid.GetACLTypeByName(name)
    if existed_type != nil && existed_type != type
      error = false

      if id_item != nil
        numACLs = Squid.NumACLsByName(name)
        if name != old_name && Ops.greater_than(numACLs, 0) ||
            name == old_name && Ops.greater_than(numACLs, 1)
          error = true
        end
      else
        error = true
      end

      if error
        ok = false
        Report.Error(
          Ops.add(
            Ops.add(
              Builtins.sformat(
                _("ACL Group '%1' already exists with different type.\n"),
                name
              ),
              Builtins.sformat(
                _("ACL Group '%1' must have type '%2'.\n"),
                name,
                existed_type
              )
            ),
            _(
              "If you want to change the type of this ACL Group, you must\ndelete other ACL Groups with the same name before that.\n"
            )
          )
        )
      end
    end

    #verification where name is changed and this ACL has 1 occurrence
    if ok && id_item != nil && old_name != name &&
        Squid.NumACLs(id_item) == 1
      #test if changed ACL is used in http_access option.
      if Ops.greater_than(Builtins.size(affected_options), 0) &&
          Builtins.contains(affected_options, "http_access")
        Report.Error(
          _(
            "You can not change the name of this ACL Group, because \nit is used in the Access Control table.\n"
          ) +
            _(
              "If you want to change name of this ACL Group you must\ndelete all of its occurrences in Access Control table."
            )
        )
        ok = false
      #test if changed ACL is used in other option (not managed by thid module)
      elsif Ops.greater_than(Builtins.size(affected_options), 0)
        if !Report.AnyQuestion(
            Label.WarningMsg,
            Ops.add(
              Ops.add(
                _(
                  "If you change the name of this ACL Group, these options might be affected: \n"
                ) + "    ",
                Builtins.mergestring(affected_options, ",\n    ")
              ),
              ".\n"
            ),
            _("Change name anyway"),
            _("Do not change name"),
            :focus_no
          )
          ok = false
        end
      end
    end
  elsif verification
    #test, if name is filled
    ok = false
    Report.Error(_("Name must not be empty."))
  else
    ok = false
  end

  if ok && id_item == nil
    Squid.AddACL(name, type, options)
  elsif ok
    Squid.ModifyACL(id_item, name, type, options)
  end
  ok
end

- (Object) StoreDataFromAddEditHttpAccessDialog(id_item)

************* HTTP_ACCESS ********************



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
# File '../../src/include/squid/store_del.rb', line 324

def StoreDataFromAddEditHttpAccessDialog(id_item)
  ok = true
  allow = true
  acls = []
  tmp = ""

  allow = UI.QueryWidget(Id("allow_deny"), :Value) == "allow" ? true : false
  Builtins.foreach(
    Convert.convert(
      UI.QueryWidget(Id("acls"), :Items),
      :from => "any",
      :to   => "list <term>"
    )
  ) do |value|
    tmp = Ops.get_string(value, 1, "") == "not" ? "!" : ""
    tmp = Ops.add(tmp, Ops.get_string(value, 2, ""))
    acls = Builtins.add(acls, tmp)
  end

  if Ops.greater_than(Builtins.size(acls), 0)
    if id_item == nil
      Squid.AddHttpAccess(allow, acls)
    else
      Squid.ModifyHttpAccess(id_item, allow, acls)
    end
  else
    ok = false
    Report.Error(_("ACL table must not be empty."))
  end

  ok
end

- (Object) StoreDataFromAddEditHttpPortDialog(id_item)

**************** HTTP_PORT *******************



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
# File '../../src/include/squid/store_del.rb', line 49

def StoreDataFromAddEditHttpPortDialog(id_item)
  ok = true
  host = Convert.to_string(UI.QueryWidget(Id("host"), :Value))
  port = Convert.to_string(UI.QueryWidget(Id("port"), :Value))
  transparent = Convert.to_boolean(
    UI.QueryWidget(Id("transparent"), :Value)
  )
  error_msg = ""

  if Builtins.size(port) == 0
    error_msg = Ops.add(
      Ops.add(
        error_msg,
        Ops.greater_than(Builtins.size(error_msg), 0) ? "\n" : ""
      ),
      _("Port number must not be empty.")
    )
    ok = false
  end
  if Ops.greater_than(Builtins.size(host), 0) && !isCorrectHost(host)
    error_msg = Ops.add(
      Ops.add(
        error_msg,
        Ops.greater_than(Builtins.size(error_msg), 0) ? "\n" : ""
      ),
      _("Host must contain valid IP address or hostname.")
    )
    ok = false
  end


  if ok
    if id_item == nil
      Squid.AddHttpPort(host, port, transparent)
    else
      Squid.ModifyHttpPort(id_item, host, port, transparent)
    end
  else
    Report.Error(error_msg)
  end

  ok
end

- (Object) StoreDataFromAddEditRefreshPatternDialog(id_item)

************* REFRESH_PATTERNS ***************



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
# File '../../src/include/squid/store_del.rb', line 105

def StoreDataFromAddEditRefreshPatternDialog(id_item)
  ok = true
  regexp = Convert.to_string(UI.QueryWidget(Id("regexp"), :Value))
  min = Builtins.tostring(UI.QueryWidget(Id("min"), :Value))
  percent = Builtins.tostring(UI.QueryWidget(Id("percent"), :Value))
  max = Builtins.tostring(UI.QueryWidget(Id("max"), :Value))
  case_sensitive = !Convert.to_boolean(
    UI.QueryWidget(Id("regexp_case_insensitive"), :Value)
  )

  if Ops.greater_than(Builtins.size(regexp), 0)
    if id_item == nil
      Squid.AddRefreshPattern(regexp, min, percent, max, case_sensitive)
    else
      Squid.ModifyRefreshPattern(
        id_item,
        regexp,
        min,
        percent,
        max,
        case_sensitive
      )
    end
  else
    Report.Error(_("Regular expression must not be empty."))
    ok = false
  end

  ok
end

- (Object) StoreDataFromCache2Dialog(widget_id, event)



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
# File '../../src/include/squid/store_del.rb', line 211

def StoreDataFromCache2Dialog(widget_id, event)
  event = deep_copy(event)
  Squid.SetSetting(
    "cache_mem",
    [
      Builtins.tostring(UI.QueryWidget(Id("cache_mem"), :Value)),
      UI.QueryWidget(Id("cache_mem_units"), :Value)
    ]
  )
  Squid.SetSetting(
    "maximum_object_size",
    [
      Builtins.tostring(UI.QueryWidget(Id("cache_max_object_size"), :Value)),
      UI.QueryWidget(Id("cache_max_object_size_units"), :Value)
    ]
  )
  Squid.SetSetting(
    "minimum_object_size",
    [
      Builtins.tostring(UI.QueryWidget(Id("cache_min_object_size"), :Value)),
      UI.QueryWidget(Id("cache_min_object_size_units"), :Value)
    ]
  )
  Squid.SetSetting(
    "cache_swap_low",
    [Builtins.tostring(UI.QueryWidget(Id("cache_swap_low"), :Value))]
  )
  Squid.SetSetting(
    "cache_swap_high",
    [Builtins.tostring(UI.QueryWidget(Id("cache_swap_high"), :Value))]
  )
  Squid.SetSetting(
    "cache_replacement_policy",
    [UI.QueryWidget(Id("cache_replacement_policy"), :Value)]
  )
  Squid.SetSetting(
    "memory_replacement_policy",
    [UI.QueryWidget(Id("memory_replacement_policy"), :Value)]
  )

  nil
end

- (Object) StoreDataFromCacheDirectoryDialog(widget_id, event)



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File '../../src/include/squid/store_del.rb', line 302

def StoreDataFromCacheDirectoryDialog(widget_id, event)
  event = deep_copy(event)
  squid_cache_dir = Squid.GetSetting("cache_dir")

  Squid.SetSetting(
    "cache_dir",
    [
      Ops.get_string(squid_cache_dir, 0, ""),
      Convert.to_string(UI.QueryWidget(Id("cache_dir"), :Value)),
      Builtins.tostring(UI.QueryWidget(Id("mbytes"), :Value)),
      Builtins.tostring(UI.QueryWidget(Id("l1dirs"), :Value)),
      Builtins.tostring(UI.QueryWidget(Id("l2dirs"), :Value))
    ]
  )

  nil
end

- (Object) StoreDataFromLoggingFrame(widget_id, event)



638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
# File '../../src/include/squid/store_del.rb', line 638

def StoreDataFromLoggingFrame(widget_id, event)
  event = deep_copy(event)
  access_log = Convert.to_string(UI.QueryWidget(Id("access_log"), :Value))
  cache_log = Convert.to_string(UI.QueryWidget(Id("cache_log"), :Value))
  cache_store_log = Convert.to_string(
    UI.QueryWidget(Id("cache_store_log"), :Value)
  )
  emulate_httpd_log = Convert.to_boolean(
    UI.QueryWidget(Id("emulate_httpd_log"), :Value)
  ) ? "on" : "off"

  tmp = Squid.GetSetting("access_log")
  Squid.SetSetting(
    "access_log",
    Builtins.prepend(Builtins.remove(tmp, 0), access_log)
  )
  Squid.SetSetting("cache_log", [cache_log])
  Squid.SetSetting("cache_store_log", [cache_store_log])
  Squid.SetSetting("emulate_httpd_log", [emulate_httpd_log])

  nil
end

- (Object) StoreDataFromMiscellaneousFrame(widget_id, event)



699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
# File '../../src/include/squid/store_del.rb', line 699

def StoreDataFromMiscellaneousFrame(widget_id, event)
  event = deep_copy(event)
  error_language = Convert.to_string(
    UI.QueryWidget(Id("error_language"), :Value)
  )
  cache_mgr = Convert.to_string(UI.QueryWidget(Id("cache_mgr"), :Value))
  ftp_passive = Convert.to_boolean(
    UI.QueryWidget(Id("ftp_passive"), :Value)
  ) ? "on" : "off"

  Squid.SetSetting(
    "error_directory",
    [SquidErrorMessages.GetPath(error_language)]
  )
  Squid.SetSetting("cache_mgr", [cache_mgr])
  Squid.SetSetting("ftp_passive", [ftp_passive])

  nil
end

- (Object) StoreDataFromTimeoutsFrame(widget_id, event)



661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
# File '../../src/include/squid/store_del.rb', line 661

def StoreDataFromTimeoutsFrame(widget_id, event)
  event = deep_copy(event)
  Squid.SetSetting(
    "connect_timeout",
    [
      Builtins.tostring(UI.QueryWidget(Id("connect_timeout"), :Value)),
      Convert.to_string(UI.QueryWidget(Id("connect_timeout_units"), :Value))
    ]
  )
  Squid.SetSetting(
    "client_lifetime",
    [
      Builtins.tostring(UI.QueryWidget(Id("client_lifetime"), :Value)),
      Convert.to_string(UI.QueryWidget(Id("client_lifetime_units"), :Value))
    ]
  )

  nil
end

- (Object) ValidateCache2Dialog(widget_id, event)

************* CACHE DIALOG *******************



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
# File '../../src/include/squid/store_del.rb', line 172

def ValidateCache2Dialog(widget_id, event)
  event = deep_copy(event)
  ok = true

  if Ops.get(event, "ID") != :abort
    cache_mem = Ops.multiply(
      Convert.to_integer(UI.QueryWidget(Id("cache_mem"), :Value)),
      unitToMultiple(
        Convert.to_string(UI.QueryWidget(Id("cache_mem_units"), :Value))
      )
    )
    cache_dir_str = Squid.GetSetting("cache_dir")
    cache_dir_mbytes = Ops.multiply(
      Ops.multiply(Builtins.tointeger(Ops.get(cache_dir_str, 2, "0")), 1024),
      1024
    )
    max_obj_size = Ops.multiply(
      Convert.to_integer(
        UI.QueryWidget(Id("cache_max_object_size"), :Value)
      ),
      unitToMultiple(
        Convert.to_string(
          UI.QueryWidget(Id("cache_max_object_size_units"), :Value)
        )
      )
    )

    if Ops.greater_than(max_obj_size, Ops.add(cache_mem, cache_dir_mbytes))
      ok = false
      Report.Error(
        _(
          "Cache Memory + Size of Cache Directory\nmust be higher than Max Object Size.\n"
        )
      )
    end
  end

  ok
end

- (Object) ValidateCacheDirectoryDialog(widget_id, event)



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
# File '../../src/include/squid/store_del.rb', line 255

def ValidateCacheDirectoryDialog(widget_id, event)
  event = deep_copy(event)
  ok = true

  if Ops.get(event, "ID") != :abort
    cache_dir = Convert.to_string(UI.QueryWidget(Id("cache_dir"), :Value))

    if Builtins.size(cache_dir) == 0
      ok = false
      Report.Error(_("Cache directory must not be empty."))
    elsif Mode.normal && !FileUtils.CheckAndCreatePath(cache_dir)
      ok = false
    else
      cache_mem_str = Squid.GetSetting("cache_mem")
      cache_mem = Ops.multiply(
        Builtins.tointeger(Ops.get(cache_mem_str, 0, "0")),
        unitToMultiple(Ops.get(cache_mem_str, 1, "KB"))
      )
      cache_dir_mbytes = Ops.multiply(
        Ops.multiply(
          Convert.to_integer(UI.QueryWidget(Id("mbytes"), :Value)),
          1024
        ),
        1024
      )
      max_obj_size_str = Squid.GetSetting("maximum_object_size")
      max_obj_size = Ops.multiply(
        Builtins.tointeger(Ops.get(max_obj_size_str, 0, "0")),
        unitToMultiple(Ops.get(max_obj_size_str, 1, "KB"))
      )

      if Ops.greater_than(
          max_obj_size,
          Ops.add(cache_mem, cache_dir_mbytes)
        )
        ok = false
        Report.Error(
          _(
            "Cache Memory + Size of Cache Directory\nmust be higher than Max Object Size.\n"
          )
        )
      end
    end
  end

  ok
end

- (Object) ValidateLoggingFrame(widget_id, event)

******* LOGGING AND TIMEOUTS DIALOG **********



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
# File '../../src/include/squid/store_del.rb', line 560

def ValidateLoggingFrame(widget_id, event)
  event = deep_copy(event)
  if Ops.get(event, "ID") != :abort
    ok = true
    message = ""
    access_log = Convert.to_string(UI.QueryWidget(Id("access_log"), :Value))
    cache_log = Convert.to_string(UI.QueryWidget(Id("cache_log"), :Value))
    cache_store_log = Convert.to_string(
      UI.QueryWidget(Id("cache_store_log"), :Value)
    )
    emulate_httpd_log = Convert.to_boolean(
      UI.QueryWidget(Id("emulate_httpd_log"), :Value)
    ) ? "on" : "off"

    if Builtins.size(access_log) == 0
      ok = false
      message = Ops.add(
        Ops.add(
          message,
          Ops.greater_than(Builtins.size(message), 0) ? "\n" : ""
        ),
        _("Access Log must not be empty.")
      )
    end
    if Builtins.size(cache_log) == 0
      ok = false
      message = Ops.add(
        Ops.add(
          message,
          Ops.greater_than(Builtins.size(message), 0) ? "\n" : ""
        ),
        _("Cache Log must not be empty.")
      )
    end
    if Ops.greater_than(Builtins.size(access_log), 0) && Mode.normal &&
        !isCorrectPathnameOfLogFile(access_log)
      ok = false
      message = Ops.add(
        Ops.add(
          message,
          Ops.greater_than(Builtins.size(message), 0) ? "\n" : ""
        ),
        _("Incorrect pathname in Access Log field.")
      )
    end
    if Ops.greater_than(Builtins.size(cache_log), 0) && Mode.normal &&
        !isCorrectPathnameOfLogFile(cache_log)
      ok = false
      message = Ops.add(
        Ops.add(
          message,
          Ops.greater_than(Builtins.size(message), 0) ? "\n" : ""
        ),
        _("Incorrect pathname in Cache Log field.")
      )
    end
    if Ops.greater_than(Builtins.size(cache_store_log), 0) && Mode.normal &&
        !isCorrectPathnameOfLogFile(cache_store_log)
      ok = false
      message = Ops.add(
        Ops.add(
          message,
          Ops.greater_than(Builtins.size(message), 0) ? "\n" : ""
        ),
        _("Incorrect pathname in Cache Store Log field.")
      )
    end
    # if (size(cache_store_log) == 0){
    #    ok = false;
    #    message = message + (size(message)>0 ? "\n" : "") + _("Cache Store Log must not be empty.");
    # }

    Report.Error(message) if !ok

    return ok
  end
  true
end

- (Object) ValidateMiscellaneousFrame(widget_id, event)

******* LOGGING AND TIMEOUTS DIALOG END ******



682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
# File '../../src/include/squid/store_del.rb', line 682

def ValidateMiscellaneousFrame(widget_id, event)
  event = deep_copy(event)
  if Ops.get(event, "ID") != :abort
    ok = true
    cache_mgr = Convert.to_string(UI.QueryWidget(Id("cache_mgr"), :Value))

    if Builtins.regexpmatch(cache_mgr, "[ \t\n]")
      ok = false
      Report.Error(
        _("Administrator's email must not contain any white spaces.")
      )
    end

    return ok
  end
  true
end