Diff
Not logged in

Differences From Artifact [a43b2e63ae]:

To Artifact [d6b5aeeb48]:


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
302
303
304
305
306
307
308













309
310
311
312
313

314
315


316
317
318
319
320
321
322
323
324







-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+

-
+

-
-
+
+







  if( zPw==0 ) return 0;
  if( zPw[0]==0 ) return 1;
  while( zPw[0]=='*' ){ zPw++; }
  return zPw[0]!=0;
}

/*
** Return 1 if user capability string zCaps contains the given
** capability letter, else 0.
*/
static int userCapsContain(const char *zCaps, const char letter){
  for( ; zCaps && *zCaps; ++zCaps ){
    if( letter==*zCaps ) return 1;
  }
  return 0;
}

/*
** Return 1 if user capability string zNew contains any capability
** letter which is not in user capability string zOrig, else 0.
** Return true if user capability string zNew contains any capability
** letter which is not in user capability string zOrig, else 0.  This
** does not take inherited permissions into account. Either argument
** may be NULL.
*/
static int userCapsAreElevated(const char *zOrig, const char *zNew){
static int userHasNewCaps(const char *zOrig, const char *zNew){
  for( ; zNew && *zNew; ++zNew ){
    if( !userCapsContain(zOrig, *zNew) ){
      return 1;
    if( !zOrig || strchr(zOrig,*zNew)==0 ){
      return *zNew;
    }
  }
  return 0;
}

/*
** WEBPAGE: setup_uedit
484
485
486
487
488
489
490

491
492
493
494


495
496
497
498
499
500
501
475
476
477
478
479
480
481
482
483
484


485
486
487
488
489
490
491
492
493







+


-
-
+
+







        db_multi_exec("UPDATE subscriber SET suname=%Q WHERE suname=%Q",
                      zLogin, zOldLogin);
      }
      admin_log( "Renamed user [%q] to [%q].", zOldLogin, zLogin );
    }
    db_protect_pop();
    setup_incr_cfgcnt();
    @ zOldCaps=%s(zOldCaps) aCap=%s(&aCap[0])<br>
    admin_log( "Updated user [%q] with%s capabilities [%q].",
               zLogin,
               userCapsAreElevated(zOldCaps, &aCap[0])
               ? " elevated" : "",
               userHasNewCaps(zOldCaps, &aCap[0])
               ? " new" : "",
               &aCap[0] );
    if( atoi(PD("all","0"))>0 ){
      Blob sql;
      char *zErr = 0;
      blob_zero(&sql);
      if( zOldLogin==0 ){
        blob_appendf(&sql,