Documentation ¶
Index ¶
- Constants
- Variables
- func AppVersionStr() string
- func App_db_upgrade() (err error)
- func CheckPWRules(ctx PfCtx, password string) (err error)
- func Chk_ident(name string, in string) (out string, err error)
- func CopyDir(ctx PfCtx, verbose bool, source string, dest string) (err error)
- func CopyFile(ctx PfCtx, verbose bool, source string, dest string) (err error)
- func CreateKey(length int) (out string, err error)
- func DB_Init(verbosity bool)
- func DB_IsPQErrorConstraint(err error) bool
- func DB_SetAppVersion(ver int)
- func Daemon(nochdir int, noclose int) (err error)
- func Dbg(message string)
- func DbgA(off int, format string, a ...interface{})
- func Dbgf(format string, a ...interface{})
- func DetailCheck(detail string) (err error)
- func DetailType(detail string) (out string)
- func Diff_Out(ctx PfCtx, a string, b string)
- func EncodeKey(secret string) (out string)
- func Err(message string)
- func ErrA(off int, format string, a ...interface{})
- func ErrIsDisconnect(err error) bool
- func ErrIsUnknownCommand(err error) bool
- func Errf(format string, a ...interface{})
- func File_ChildPagesMax(ctx PfCtx, path string) (total int, err error)
- func File_ModOpts(ctx PfCtx, cmdpfx string, path_root string, web_root string)
- func File_RevisionMax(ctx PfCtx, path string) (total int, err error)
- func File_Update(ctx PfCtx, path string, desc string, changemsg string, file *os.File) (err error)
- func File_add_file(ctx PfCtx, path string, description string, file io.Reader) (err error)
- func File_add_localfile(ctx PfCtx, args []string) (err error)
- func File_add_url(ctx PfCtx, args []string) (err error)
- func File_delete(ctx PfCtx, path string, children bool) (cnt int, err error)
- func File_menu(ctx PfCtx, args []string) (err error)
- func File_path_is_dir(path string) (is_dir bool)
- func File_search(ctx PfCtx, pathroot string, c chan PfSearchResult, search string, ...) (err error)
- func Fmt_Time(t time.Time) string
- func Fullname_to_ident(name string) (out string, err error)
- func GetPID() (pid string)
- func Group_FileMod(ctx PfCtx)
- func Group_WikiMod(ctx PfCtx)
- func HE(str string) string
- func HEB(str string) template.HTML
- func HashIt(input string) (hash string)
- func Hex(data []byte) string
- func Image_resize(file io.Reader, maxsize string) (bits []byte, err error)
- func Iptrk_count(ip string) (limited bool)
- func Iptrk_reset(ip string) (ret bool)
- func Iptrk_start(max int, timeoutchk time.Duration, expire string)
- func Iptrk_stop()
- func IsTrue(val string) (b bool)
- func JwtInv_start(timeoutchk time.Duration)
- func JwtInv_stop()
- func JwtInv_test_cache_len() int
- func JwtInv_test_expire() (before int, after int, err error)
- func JwtInv_test_iscached(tok string) (ok bool)
- func JwtInv_test_list_len() int
- func Jwt_invalidate(tok string, claims JWTClaimI)
- func Jwt_isinvalidated(tok string, claims JWTClaimI) (invalid bool)
- func LanguageSkillList() (languageskill []string)
- func ListKeys(ctx PfCtx, keyset map[[16]byte][]byte, gr_name string, ml_name string) (err error)
- func Log(message string)
- func LogA(off int, format string, a ...interface{})
- func LogLoc(off int, pfx string) string
- func Logf(format string, a ...interface{})
- func Mail(ctx PfCtx, src_name string, src string, dst_name string, dst string, ...) (err error)
- func MailM(ctx PfCtx, src_name string, src string, dst_name []string, dst []string, ...) (err error)
- func Mail_PasswordChanged(ctx PfCtx, email PfUserEmail) (err error)
- func Mail_VerifyEmail(ctx PfCtx, email PfUserEmail, verifycode string) (err error)
- func Ml_addv(ctx PfCtx, grp PfGroup, ml_name string, descr string, member_only bool, ...) (err error)
- func Msg_Create(ctx PfCtx, path string, title string, plaintext string, notify bool) (newpath string, err error)
- func Msg_Create_With_User(ctx PfCtx, user PfUser, path string, title string, plaintext string, ...) (newpath string, err error)
- func Msg_MarkNew(ctx PfCtx, msg PfMessage) (err error)
- func Msg_MarkSeen(ctx PfCtx, msg PfMessage) (err error)
- func Msg_ModOpts(ctx PfCtx, cmdpfx string, path_root string, web_root string, thread_depth int, ...)
- func Msg_ModPathDepth(ctx PfCtx) (depth int)
- func Msg_PathDepth(ctx PfCtx, path string) (depth int)
- func Msg_PathValid(ctx PfCtx, path *string) (err error)
- func Msg_Post(ctx PfCtx, path string, title string, plaintext string) (newpath string, err error)
- func Msg_menu(ctx PfCtx, args []string) (err error)
- func NI64(n int64) sql.NullInt64
- func NewPfUserEmailI() interface{}
- func NormalizeBoolean(val string) string
- func OAuth2_AccessToken_New(ctx PfCtx, client_id string, scope string) (tok string, err error)
- func OAuth2_AuthToken_New(ctx PfCtx, o OAuth_Auth) (tok string, err error)
- func ObjFunc(obj ObjFuncI, fun string, params ...interface{}) (result []reflect.Value, err error)
- func ObjFuncIface(obj ObjFuncI, fun string, params ...interface{}) (iface interface{}, err error)
- func ObjFuncStr(obj ObjFuncI, fun string, params ...interface{}) (str string, err error)
- func ObjPermCheck(ctx PfCtx, obj ObjFuncI, ptype PType, f PTypeField) (ok bool, allowedit bool, err error)
- func OutA(format string, a ...interface{})
- func OutEsc(str string) (nstr string)
- func PathOffset(file_path string, dir_path string) (count int)
- func PfRender(markdown string, toconly bool) (html string)
- func PfType(f reflect.StructField, v reflect.Value, doignore bool) (ttype string, dorecurse bool, compound bool)
- func Pw_checkweak(password string) (isweak bool)
- func Pw_checkweak_load() (err error)
- func Rand_number(max int) int
- func SearchResult(c chan PfSearchResult, source string, title string, link string, ...)
- func SearcherRegister(f PfSearcherI)
- func SetAppDetails(name string, ver string, copyright string, website string)
- func SetUID(username string) (err error)
- func Setup(toolname string, confroot string, verbosedb bool, app_schema_version int) (err error)
- func SetupTranslation() (err error)
- func SortKeys(tbl map[string]string) (keys []string)
- func SplitArgs(str string) (args []string)
- func Starts()
- func Stops()
- func StorePID(filename string, pid string)
- func StructDetails(ctx PfCtx, obj interface{}, field string, opts StructDetails_Options) (ftype string, fname string, fvalue string, err error)
- func StructDetailsA(ctx PfCtx, obj interface{}, field string, opts StructDetails_Options) (ftype string, fname string, fvalue string, err error)
- func StructFetch(obj interface{}, table string, params []string, matches []string) (err error)
- func StructFetchA(obj interface{}, table string, join string, params []string, matches []string, ...) (err error)
- func StructFetchFields(obj interface{}, table string, q *string, ifs *[]interface{}) (err error)
- func StructFetchMulti(newobject func() interface{}, table string, join string, andor DB_AndOr, ...) (objs []interface{}, err error)
- func StructFetchStore(obj interface{}, ifs []interface{}, ifs_n *int) (err error)
- func StructFetchWhere(qi string, table string, join string, andor DB_AndOr, params []string, ...) (q string, vals []interface{})
- func StructFieldMod(op StructOp, fname string, f reflect.StructField, v reflect.Value, ...) (err error)
- func StructMod(op StructOp, obj interface{}, field string, value interface{}) (err error)
- func StructModA(op StructOp, obj interface{}, field string, value interface{}) (done bool, err error)
- func StructNameObj(obj interface{}) string
- func StructNameObjTrail(objtrail []interface{}) (oname string)
- func StructNameT(t reflect.Type) string
- func StructPermCheck(ctx PfCtx, ptype PType, objtrail []interface{}, f PTypeField) (ok bool, allowedit bool, err error)
- func StructRecurse(v reflect.Value) interface{}
- func StructReflect(obj interface{}) (s reflect.Type, va reflect.Value)
- func StructTag(obj interface{}, field string, tag string) (val string, err error)
- func StructTagA(obj interface{}, field string, tag string) (val string, err error)
- func StructVars(ctx PfCtx, obj interface{}, ptype PType, doignore bool) (vars map[string]string, err error)
- func StructVarsA(ctx PfCtx, objtrail []interface{}, obj interface{}, ptype PType, doignore bool, ...) (err error)
- func System_AuditMax(search string, user_name string, gr_name string) (total int, err error)
- func System_SharedFile(thefile string) (fn string, err error)
- func System_adduser(username string, password string) (err error)
- func System_db_cleanup() (err error)
- func System_db_setup() (err error)
- func System_db_test_setup() (err error)
- func System_db_upgrade() (err error)
- func System_findfile(subdir string, name string) (fn string)
- func System_setpassword(username string, password string) (err error)
- func Template_FuncAdd(name string, f interface{})
- func Template_Get() *template.Template
- func Template_Load() (err error)
- func ThisFunc() string
- func ToNullInt64(v int64) sql.NullInt64
- func ToNullString(s string) sql.NullString
- func ToString(v interface{}) (str string)
- func ToUTF8(iso8859_1_buf []byte) string
- func Token_Parse(tok string, ttype string, claims JWTClaimI) (expsoon bool, err error)
- func TrackStart() time.Time
- func TrackTime(start time.Time, name string) (elapsed time.Duration)
- func TranslateObj(ctx PfCtx, objtrail []interface{}, label string) string
- func TwoFactorTypes() (types keyval.KeyVals)
- func URL_Append(url1 string, url2 string) (url string)
- func URL_EnsureSlash(url string) string
- func User_Email_Verify(ctx PfCtx, username string, emailaddr string) (err error)
- func User_merge(ctx PfCtx, u_new string, u_old string, err_ error) (err error)
- func User_new(ctx PfCtx, username string, email string, bio_info string, affiliation string, ...) (err error)
- func VersionText() string
- func Where(off int) string
- func Wiki_ChildPagesMax(ctx PfCtx, path string) (total int, err error)
- func Wiki_ModOpts(ctx PfCtx, cmdpfx string, path_root string, web_root string)
- func Wiki_RevisionMax(ctx PfCtx, path string) (total int, err error)
- func Wiki_SearchMax(ctx PfCtx, search string) (total int, err error)
- func Wiki_Title(path string) (title string)
- func Wiki_TitleComponent(title string) string
- func Wiki_menu(ctx PfCtx, args []string) (err error)
- func Wiki_search(ctx PfCtx, pathroot string, c chan PfSearchResult, search string, ...) (err error)
- func YesNo(b bool) (val string)
- type DB_AndOr
- type DB_Op
- type IPtrkEntry
- type IPtrkS
- type JWTClaimI
- type JWTClaims
- type MsgType
- type OAuth2Claims
- type OAuth_Auth
- type ObjFuncI
- type PType
- type PTypeField
- type Perm
- type PfAppPermsI
- type PfAudit
- type PfConfig
- type PfCreds
- type PfCtx
- type PfCtxS
- func (ctx *PfCtxS) Batch(filename string) (err error)
- func (ctx *PfCtxS) Become(user PfUser)
- func (ctx *PfCtxS) Buffered() (o string)
- func (ctx *PfCtxS) CanBeSysAdmin() bool
- func (ctx *PfCtxS) CheckPerms(what string, perms Perm) (ok bool, err error)
- func (ctx *PfCtxS) CheckPermsT(what string, permstr string) (ok bool, err error)
- func (ctx *PfCtxS) Cmd(args []string) (err error)
- func (ctx *PfCtxS) CmdOut(cmd string, args []string) (msg string, err error)
- func (ctx *PfCtxS) ConvertPerms(str string) (perm Perm, err error)
- func (ctx *PfCtxS) Dbg(message string)
- func (ctx *PfCtxS) Dbgf(format string, a ...interface{})
- func (ctx *PfCtxS) Err(message string)
- func (ctx *PfCtxS) Errf(format string, a ...interface{})
- func (ctx *PfCtxS) GetAbort() <-chan bool
- func (ctx *PfCtxS) GetAppData() interface{}
- func (ctx *PfCtxS) GetClientIP() net.IP
- func (ctx *PfCtxS) GetLanguage() string
- func (ctx *PfCtxS) GetLastPart() string
- func (ctx *PfCtxS) GetLoc() string
- func (ctx *PfCtxS) GetModOpts() (opts interface{})
- func (ctx *PfCtxS) GetRemote() (remote string)
- func (ctx *PfCtxS) GetReturnCode() (rc int)
- func (ctx *PfCtxS) GetStatus() (code int)
- func (ctx *PfCtxS) GetTfunc() i18n.TranslateFunc
- func (ctx *PfCtxS) GetToken() (tok string)
- func (ctx *PfCtxS) GetTx() (tx *Tx)
- func (ctx *PfCtxS) GetUserAgent() (string, string, string)
- func (ctx *PfCtxS) GroupHasCalendar() bool
- func (ctx *PfCtxS) GroupHasFile() bool
- func (ctx *PfCtxS) GroupHasWiki() bool
- func (ctx *PfCtxS) HasSelectedGroup() bool
- func (ctx *PfCtxS) HasSelectedML() bool
- func (ctx *PfCtxS) HasSelectedUser() bool
- func (ctx *PfCtxS) IAmGroupAdmin() bool
- func (ctx *PfCtxS) IAmGroupMember() bool
- func (ctx *PfCtxS) Init() (err error)
- func (ctx *PfCtxS) IsBuffered() bool
- func (ctx *PfCtxS) IsGroupMember() bool
- func (ctx *PfCtxS) IsLoggedIn() bool
- func (ctx *PfCtxS) IsPerm(perms Perm, perm Perm) bool
- func (ctx *PfCtxS) IsPermSet(perms Perm, perm Perm) bool
- func (ctx *PfCtxS) IsSysAdmin() bool
- func (ctx *PfCtxS) Log(message string)
- func (ctx *PfCtxS) Logf(format string, a ...interface{})
- func (ctx *PfCtxS) Login(username string, password string, twofactor string) (err error)
- func (ctx *PfCtxS) LoginToken(tok string) (expsoon bool, err error)
- func (ctx *PfCtxS) Logout()
- func (ctx *PfCtxS) Menu(args []string, menu PfMenu) (err error)
- func (ctx *PfCtxS) MenuOverride(menu *PfMenu)
- func (ctx *PfCtxS) NewGroup() PfGroup
- func (ctx *PfCtxS) NewGroupI() interface{}
- func (ctx *PfCtxS) NewToken() (err error)
- func (ctx *PfCtxS) NewUser() PfUser
- func (ctx *PfCtxS) NewUserI() interface{}
- func (ctx *PfCtxS) Out(txt string)
- func (ctx *PfCtxS) OutBuffered(on bool)
- func (ctx *PfCtxS) OutLn(format string, a ...interface{})
- func (ctx *PfCtxS) Outf(format string, a ...interface{})
- func (ctx *PfCtxS) PDbgf(what string, perm Perm, format string, a ...interface{})
- func (ctx *PfCtxS) RestoreCreds(creds PfCreds)
- func (ctx *PfCtxS) SelectEmail(email string) (err error)
- func (ctx *PfCtxS) SelectGroup(gr_name string, perms Perm) (err error)
- func (ctx *PfCtxS) SelectGroupA(grp PfGroup, gr_name string, perms Perm) (err error)
- func (ctx *PfCtxS) SelectML(ml_name string, perms Perm) (err error)
- func (ctx *PfCtxS) SelectMe()
- func (ctx *PfCtxS) SelectObject(obj *interface{})
- func (ctx *PfCtxS) SelectUser(username string, perms Perm) (err error)
- func (ctx *PfCtxS) SelectUser2FA(id int, perms Perm) (err error)
- func (ctx *PfCtxS) SelectedEmail() (email PfUserEmail)
- func (ctx *PfCtxS) SelectedGroup() (grp PfGroup)
- func (ctx *PfCtxS) SelectedML() (ml PfML)
- func (ctx *PfCtxS) SelectedObject() (obj *interface{})
- func (ctx *PfCtxS) SelectedSelf() bool
- func (ctx *PfCtxS) SelectedUser() (user PfUser)
- func (ctx *PfCtxS) SelectedUser2FA() (tfa PfUser2FA)
- func (ctx *PfCtxS) SetAbort(abort <-chan bool)
- func (ctx *PfCtxS) SetAppData(appdata interface{})
- func (ctx *PfCtxS) SetClient(clientip net.IP, remote string, fullua string)
- func (ctx *PfCtxS) SetLanguage(name string)
- func (ctx *PfCtxS) SetModOpts(opts PfModOptsI)
- func (ctx *PfCtxS) SetOutUnbuffered(obj interface{}, fun string)
- func (ctx *PfCtxS) SetReturnCode(rc int)
- func (ctx *PfCtxS) SetStatus(code int)
- func (ctx *PfCtxS) SetTx(tx *Tx)
- func (ctx *PfCtxS) StoreCreds() (creds PfCreds)
- func (ctx *PfCtxS) SwapSysAdmin() bool
- func (ctx *PfCtxS) TheUser() (user PfUser)
- func (ctx *PfCtxS) WalkMenu(args []string) (menu *PfMEntry, err error)
- type PfDB
- func (db *PfDB) AppUpgrade() (err error)
- func (db *PfDB) Check() (msg string, err error)
- func (db *PfDB) Cleanup_psql() (err error)
- func (db *PfDB) Connect_def() (err error)
- func (db *PfDB) Err(message string)
- func (db *PfDB) Errf(format string, arg ...interface{})
- func (db *PfDB) Exec(ctx PfCtx, audittxt string, affected int64, query string, args ...interface{}) (err error)
- func (db *PfDB) ExecNA(affected int64, query string, args ...interface{}) (err error)
- func (db *PfDB) Fix_Perms() (err error)
- func (db *PfDB) GetAppSchemaVersion() (version int, err error)
- func (db *PfDB) GetSchemaVersion() (version int, err error)
- func (db *PfDB) Increase(ctx PfCtx, audittxt, table string, ident string, what string) (err error)
- func (db *PfDB) Init(verbosity bool)
- func (db *PfDB) IsSelect(query string) (ok bool)
- func (db *PfDB) QI(name string) string
- func (db *PfDB) Q_AddArg(q *string, args *[]interface{}, arg interface{})
- func (db *PfDB) Q_AddMultiClose(q *string)
- func (db *PfDB) Q_AddWhere(q *string, args *[]interface{}, str string, op string, arg interface{}, ...)
- func (db *PfDB) Q_AddWhereAnd(q *string, args *[]interface{}, str string, arg interface{})
- func (db *PfDB) Q_AddWhereAndN(q *string, args *[]interface{}, str string)
- func (db *PfDB) Q_AddWhereOpAnd(q *string, args *[]interface{}, str string, op string, arg interface{})
- func (db *PfDB) Q_AddWhereOr(q *string, args *[]interface{}, str string, arg interface{})
- func (db *PfDB) Q_AddWhereOrN(q *string, args *[]interface{}, str string)
- func (db *PfDB) Query(query string, args ...interface{}) (trows *Rows, err error)
- func (db *PfDB) QueryFix(q string) (f string)
- func (db *PfDB) QueryRow(query string, args ...interface{}) (trow *Row)
- func (db *PfDB) QueryRowA(ctx PfCtx, audittxt string, query string, args ...interface{}) (trow *Row)
- func (db *PfDB) QueryRowNA(query string, args ...interface{}) (trow *Row)
- func (db *PfDB) SetAppVersion(version int)
- func (db *PfDB) Setup_DB() (err error)
- func (db *PfDB) Setup_psql() (err error)
- func (db *PfDB) Silence(braaf bool)
- func (db *PfDB) SizeReport(num int) (sizes [][]string, err error)
- func (db *PfDB) TxBegin(ctx PfCtx) (err error)
- func (db *PfDB) TxCommit(ctx PfCtx) (err error)
- func (db *PfDB) TxRollback(ctx PfCtx)
- func (db *PfDB) UpdateField(ctx PfCtx, obj interface{}, ident string, table string, what string, ...) (updated bool, err error)
- func (db *PfDB) UpdateFieldMsg(ctx PfCtx, obj interface{}, ident string, table string, what string, ...) (err error)
- func (db *PfDB) UpdateFieldMulti(ctx PfCtx, obj interface{}, idents map[string]string, table string, ...) (updated bool, err error)
- func (db *PfDB) UpdateFieldMultiMsg(ctx PfCtx, obj interface{}, set map[string]string, table string, what string, ...) (err error)
- func (db *PfDB) UpdateFieldNP(ctx PfCtx, obj interface{}, ident string, table string, what string, ...) (updated bool, err error)
- func (db *PfDB) Upgrade() (err error)
- func (db *PfDB) Verb(message string)
- func (db *PfDB) Verbf(format string, arg ...interface{})
- type PfDetail
- type PfDiff
- type PfFile
- type PfFileOpts
- type PfFileResult
- type PfFunc
- type PfGroup
- type PfGroupMember
- type PfGroupMemberS
- func (grpm *PfGroupMemberS) GetActivity() string
- func (grpm *PfGroupMemberS) GetAffiliation() string
- func (grpm *PfGroupMemberS) GetAirport() string
- func (grpm *PfGroupMemberS) GetEmail() string
- func (grpm *PfGroupMemberS) GetEntered() string
- func (grpm *PfGroupMemberS) GetFullName() string
- func (grpm *PfGroupMemberS) GetGroupAdmin() bool
- func (grpm *PfGroupMemberS) GetGroupCanSee() bool
- func (grpm *PfGroupMemberS) GetGroupDesc() string
- func (grpm *PfGroupMemberS) GetGroupName() string
- func (grpm *PfGroupMemberS) GetGroupState() string
- func (grpm *PfGroupMemberS) GetPGPKeyID() string
- func (grpm *PfGroupMemberS) GetSMS() string
- func (grpm *PfGroupMemberS) GetTel() string
- func (grpm *PfGroupMemberS) GetUserName() string
- func (grpm *PfGroupMemberS) HasPGP() bool
- func (grpm *PfGroupMemberS) SQL_Froms() string
- func (grpm *PfGroupMemberS) SQL_Scan(rows *Rows) (err error)
- func (grpm *PfGroupMemberS) SQL_Selects() (q string)
- func (grpm *PfGroupMemberS) Set(groupname, groupdesc, username, fullname, affiliation string, groupadmin bool, ...)
- type PfGroupS
- func (grp *PfGroupS) Add_default_mailinglists(ctx PfCtx) (err error)
- func (grp *PfGroupS) Exists(group_name string) (exists bool)
- func (grp *PfGroupS) GetGroupDesc() string
- func (grp *PfGroupS) GetGroupName() string
- func (grp *PfGroupS) GetGroups(ctx PfCtx, username string) (members []PfGroupMember, err error)
- func (grp *PfGroupS) GetGroupsAll() (members []PfGroupMember, err error)
- func (grp *PfGroupS) GetKeys(ctx PfCtx, keyset map[[16]byte][]byte) (err error)
- func (grp *PfGroupS) GetVcards() (vcard string, err error)
- func (grp *PfGroupS) HasCalendar() bool
- func (grp *PfGroupS) HasFile() bool
- func (grp *PfGroupS) HasWiki() bool
- func (grp *PfGroupS) IsMember(user string) (ismember bool, isadmin bool, out PfMemberState, err error)
- func (grp *PfGroupS) ListGroupMembers(search string, username string, offset int, max int, nominated bool, ...) (members []PfGroupMember, err error)
- func (grp *PfGroupS) ListGroupMembersTot(search string) (total int, err error)
- func (grp *PfGroupS) Member_add(ctx PfCtx) (err error)
- func (grp *PfGroupS) Member_remove(ctx PfCtx) (err error)
- func (grp *PfGroupS) Member_set_admin(ctx PfCtx, isadmin bool) (err error)
- func (grp *PfGroupS) Member_set_state(ctx PfCtx, state string) (err error)
- func (grp *PfGroupS) Refresh() (err error)
- func (grp *PfGroupS) Select(ctx PfCtx, group_name string, perms Perm) (err error)
- func (grp *PfGroupS) String() string
- type PfLanguage
- type PfMEntry
- type PfML
- func (ml *PfML) GetKey(ctx PfCtx, keyset map[[16]byte][]byte) (err error)
- func (ml *PfML) IsMember(user PfUser) (ok bool, err error)
- func (ml *PfML) List(ctx PfCtx, grp PfGroup) (mls []PfML, err error)
- func (ml *PfML) ListGroupMembers(search string, offset int, max int) (members []PfMLUser, err error)
- func (ml *PfML) ListGroupMembersMax(search string) (total int, err error)
- func (ml *PfML) ListWithUser(ctx PfCtx, grp PfGroup, user PfUser) (mls []PfML, err error)
- func (ml *PfML) Refresh() (err error)
- func (ml *PfML) Select(ctx PfCtx, grp PfGroup, ml_name string, perms Perm) (err error)
- type PfMLUser
- type PfMemberState
- type PfMenu
- type PfMenuI
- type PfMessage
- type PfModOptsI
- type PfModOptsS
- type PfMsgOpts
- type PfNewCtx
- type PfNewGroupI
- type PfNewUserI
- type PfPWRules
- type PfPass
- func (pw *PfPass) GenPass(length int) (pass string, err error)
- func (pw *PfPass) GenRand(length int) (bytes []byte, err error)
- func (pw *PfPass) GenRandHex(length int) (hex string, err error)
- func (pw *PfPass) Make(password string) (hash string, err error)
- func (pw *PfPass) SOTPHash(secret string) (out string)
- func (pw *PfPass) Verify(password string, hashedPassword string) (err error)
- func (pw *PfPass) VerifyHOTP(key string, counter int64, twofactor string) bool
- func (pw *PfPass) VerifyPWRules(password string, r PfPWRules) (probs []string)
- func (pw *PfPass) VerifySOTP(key string, twofactor string) bool
- func (pw *PfPass) VerifyTOTP(key string, twofactor string) bool
- type PfPostBecomeI
- type PfPostCreateI
- type PfPostFetchI
- type PfQuery
- type PfRenderer
- type PfSearchResult
- type PfSearcherI
- type PfSys
- type PfUser
- type PfUser2FA
- type PfUserDetail
- type PfUserEmail
- type PfUserLanguage
- type PfUserS
- func (user *PfUserS) CanBeSysAdmin() bool
- func (user *PfUserS) CheckAuth(ctx PfCtx, username string, password string, twofactor string) (err error)
- func (user *PfUserS) Create(ctx PfCtx, username string, email string, bio_info string, affiliation string, ...) (err error)
- func (user *PfUserS) Fetch2FA() (tokens []PfUser2FA, err error)
- func (user *PfUserS) Get(what string) (val string, err error)
- func (user *PfUserS) GetAffiliation() string
- func (user *PfUserS) GetDetails() (details []PfUserDetail, err error)
- func (user *PfUserS) GetFirstName() string
- func (user *PfUserS) GetFullName() string
- func (user *PfUserS) GetGroups(ctx PfCtx) (groups []PfGroupMember, err error)
- func (user *PfUserS) GetHideEmail() (hide_email bool)
- func (user *PfUserS) GetImage(ctx PfCtx) (img []byte, err error)
- func (user *PfUserS) GetKeys(ctx PfCtx, keyset map[[16]byte][]byte) (err error)
- func (user *PfUserS) GetLanguages() (output []PfUserLanguage, err error)
- func (user *PfUserS) GetLastActivity(ctx PfCtx) (entered time.Time, ip string)
- func (user *PfUserS) GetLastName() string
- func (user *PfUserS) GetList(ctx PfCtx, search string, offset int, max int, exact bool) (users []PfUser, err error)
- func (user *PfUserS) GetListMax(search string) (total int, err error)
- func (user *PfUserS) GetLoginAttempts() int
- func (user *PfUserS) GetPriEmail(ctx PfCtx, recovery bool) (tue PfUserEmail, err error)
- func (user *PfUserS) GetPriEmailString(ctx PfCtx, recovery bool) (email string)
- func (user *PfUserS) GetSF() (sf string, err error)
- func (user *PfUserS) GetTime(what string) (val time.Time, err error)
- func (user *PfUserS) GetUserName() string
- func (user *PfUserS) GetUuid() string
- func (user *PfUserS) IsMember(ctx PfCtx, groupname string) (ismember bool)
- func (user *PfUserS) IsSysAdmin() bool
- func (user *PfUserS) PostCreate(ctx PfCtx) (err error)
- func (user *PfUserS) PostFetch(ctx PfCtx, username string, in_err error) (err error)
- func (user *PfUserS) Refresh(ctx PfCtx) (err error)
- func (user *PfUserS) Select(ctx PfCtx, username string, perms Perm) (err error)
- func (user *PfUserS) SetFirstName(name string)
- func (user *PfUserS) SetFullName(name string)
- func (user *PfUserS) SetLastName(name string)
- func (user *PfUserS) SetPassword(ctx PfCtx, pwtype string, password string) (err error)
- func (user *PfUserS) SetRecoverToken(ctx PfCtx, token string) (err error)
- func (user *PfUserS) SetSysAdmin(isone bool)
- func (user *PfUserS) SetUserName(name string)
- func (user *PfUserS) SharedGroups(ctx PfCtx, otheruser PfUser) (ok bool, err error)
- func (user *PfUserS) Verify_Password(ctx PfCtx, password string) (err error)
- func (user *PfUserS) Verify_TwoFactor(ctx PfCtx, twofactor string, id int) (err error)
- type PfWikiHTML
- type PfWikiMarkdown
- type PfWikiOpts
- type PfWikiPage
- type PfWikiResult
- type PfWikiRev
- type Row
- type Rows
- type SessionClaims
- type StructDetails_Options
- type StructOp
- type Token
- type Tx
Constants ¶
const ( StatusOK = 200 )
const ( GROUP_STATE_APPROVED = "approved" GROUP_STATE_BLOCKED = "blocked" )
const CRLF = "\r\n"
const ERR_UNKNOWN_CMDPFX = "Unknown command: "
const File_Perms_Dir os.FileMode = 0700
const File_Perms_File os.FileMode = 0600
const JWT_INVALID_CACHE_MAX = 512
const Msg_sep = "/"
The separator between the message IDs
const PAGER_PERPAGE = 10
Constants
const TOKEN_EXPIRATIONMINUTES = 20
Default Token expiration time
const Wiki_Perms_Export os.FileMode = 0755
Variables ¶
var AppCopyright = ""
var AppName = "Pitchfork"
var AppVersion = "unconfigured"
var AppWebsite = ""
var CheckTwoFactor = true
Whether we verify 2FA tokens or not (--disabletwofactor)
var Debug = false
var ErrFilePathExists = errors.New("Path already exists")
var ErrLoginIncorrect = errors.New("Login incorrect")
var ErrNoRows = sql.ErrNoRows
var (
Err_NoPassword = errors.New("Please actually provide a password")
)
var IPtrk chan IPtrkS
var IPtrk_Max int
var IPtrk_done chan bool
var IPtrk_running bool
var LogLocation = false
var MainMenu = NewPfMenu([]PfMEntry{ {"user", user_menu, 0, -1, nil, PERM_NONE, "User commands"}, {"group", group_menu, 0, -1, nil, PERM_USER, "Group commands"}, {"ml", ml_menu, 0, -1, nil, PERM_USER, "Mailing List commands"}, {"system", system_menu, 0, -1, nil, PERM_NONE, "System commands"}, })
var Msg_Props = "" +
"SELECT msg.id, msg.path, msg.depth, msg.title, " +
"msg.plaintext, msg.html, msg.entered, m.ident, m.descr, " +
"msg_read.entered " +
"FROM msg_messages msg " +
"INNER JOIN member m ON msg.member = m.ident " +
"LEFT OUTER JOIN msg_read ON msg.id = msg_read.id AND msg_read.member = $1"
var Started = time.Now().UTC()
Functions ¶
func AppVersionStr ¶
func AppVersionStr() string
func App_db_upgrade ¶
func App_db_upgrade() (err error)
func CheckPWRules ¶
func DB_IsPQErrorConstraint ¶
* Check for a Unique Violation * * "duplicate key value violates unique constraint"
func DB_SetAppVersion ¶
func DB_SetAppVersion(ver int)
func DetailCheck ¶
func DetailType ¶
func ErrA ¶
* Logging - centralized and to avoid importing log everywhere * Might extend this with extra params to make per-context tracing possible
func ErrIsDisconnect ¶
func ErrIsUnknownCommand ¶
func File_Update ¶
Called directly by UI and also CLI (TODO)
func File_add_file ¶
* Used by the UI directly and also CLI
func File_add_localfile ¶
* !! CLI only !! * * Don't call through UI as it takes a local filename, don't want to read /etc/passwd ;) * * This is also why the function is marked as PERM_SYS_ADMIN
func File_add_url ¶
func File_path_is_dir ¶
func File_search ¶
func Fullname_to_ident ¶
func Group_FileMod ¶
func Group_FileMod(ctx PfCtx)
func Group_WikiMod ¶
func Group_WikiMod(ctx PfCtx)
func Iptrk_count ¶
func Iptrk_reset ¶
func Iptrk_stop ¶
func Iptrk_stop()
func JwtInv_start ¶
func JwtInv_stop ¶
func JwtInv_stop()
func JwtInv_test_expire ¶
func JwtInv_test_iscached ¶
func JwtInv_test_list_len ¶
func JwtInv_test_list_len() int
func Jwt_invalidate ¶
func Jwt_isinvalidated ¶
func LanguageSkillList ¶
func LanguageSkillList() (languageskill []string)
func Mail ¶
func Mail(ctx PfCtx, src_name string, src string, dst_name string, dst string, prefix bool, subject string, body string, regards bool, footer string, sysfooter bool) (err error)
Wrapper around the real mailA() function so we can handle errors in a single place
func Mail_PasswordChanged ¶
func Mail_PasswordChanged(ctx PfCtx, email PfUserEmail) (err error)
func Mail_VerifyEmail ¶
func Mail_VerifyEmail(ctx PfCtx, email PfUserEmail, verifycode string) (err error)
func Ml_addv ¶
func Ml_addv(ctx PfCtx, grp PfGroup, ml_name string, descr string, member_only bool, can_add_self bool, automatic bool) (err error)
Group must be selected with PERM_GROUP_ADMIN
func Msg_Create ¶
func Msg_Create_With_User ¶
func Msg_MarkNew ¶
func Msg_MarkSeen ¶
func Msg_ModOpts ¶
func Msg_ModPathDepth ¶
* The Module Root's should never have a trailing '/' * Hence why we do not substract here compared to Msg_PathDepth()
func Msg_PathDepth ¶
* Calculate the depth of a path * A depth of 0 is the root (/)
func Msg_PathValid ¶
We ignore effective root for this as that should always be valid
func NewPfUserEmailI ¶
func NewPfUserEmailI() interface{}
func NormalizeBoolean ¶
func OAuth2_AccessToken_New ¶
func OAuth2_AuthToken_New ¶
func OAuth2_AuthToken_New(ctx PfCtx, o OAuth_Auth) (tok string, err error)
func ObjFuncIface ¶
func ObjFuncStr ¶
func ObjPermCheck ¶
func OutA ¶
func OutA(format string, a ...interface{})
Silly golang log functions just ignore errors... thus do our own
func OutEsc ¶
* Encode non-ASCII chars in URL-encoded format * This to make sure control-codes etc do not end up in output * * We encode in URL-encoded format, but we do not escape HTML chars * anything rendering those should handle that part properly. * * Note: this might not be unicode friendly
func PathOffset ¶
func PfType ¶
func PfType(f reflect.StructField, v reflect.Value, doignore bool) (ttype string, dorecurse bool, compound bool)
* Get the datatype from either the forced version * or the actual type of the field using reflection * * If 'doignore' is set return 'ignore'
func Pw_checkweak ¶
func Pw_checkweak_load ¶
func Pw_checkweak_load() (err error)
func Rand_number ¶
func SearchResult ¶
func SearchResult(c chan PfSearchResult, source string, title string, link string, summary string)
func SearcherRegister ¶
func SearcherRegister(f PfSearcherI)
func SetupTranslation ¶
func SetupTranslation() (err error)
func StructDetails ¶
func StructDetailsA ¶
func StructFetch ¶
func StructFetchA ¶
func StructFetchFields ¶
func StructFetchMulti ¶
func StructFetchStore ¶
func StructFetchWhere ¶
func StructFieldMod ¶
func StructModA ¶
func StructNameObj ¶
func StructNameObj(obj interface{}) string
func StructNameObjTrail ¶
func StructNameObjTrail(objtrail []interface{}) (oname string)
func StructNameT ¶
func StructPermCheck ¶
func StructRecurse ¶
* Check CanAddr() so that we do a recurse while * we can with ability to set, but recurse otherwise * in readonly version
func StructTagA ¶
func StructVars ¶
func StructVars(ctx PfCtx, obj interface{}, ptype PType, doignore bool) (vars map[string]string, err error)
* Return all fields of a struct that can be retrieved or modified
func StructVarsA ¶
func System_AuditMax ¶
func System_SharedFile ¶
func System_db_cleanup ¶
func System_db_cleanup() (err error)
func System_db_setup ¶
func System_db_setup() (err error)
func System_db_test_setup ¶
func System_db_test_setup() (err error)
func System_db_upgrade ¶
func System_db_upgrade() (err error)
func System_findfile ¶
func System_setpassword ¶
setup only
func Template_FuncAdd ¶
func Template_FuncAdd(name string, f interface{})
func Template_Get ¶
func Template_Load ¶
func Template_Load() (err error)
func ToNullInt64 ¶
func ToNullString ¶
func ToNullString(s string) sql.NullString
func Token_Parse ¶
func TrackStart ¶
func TranslateObj ¶
func TwoFactorTypes ¶
func URL_Append ¶
Append two parts of a URL together, adding a '/' in the middle where needed
func User_Email_Verify ¶
func User_merge ¶
Called with Tx held
func VersionText ¶
func VersionText() string
func Wiki_Title ¶
func Wiki_TitleComponent ¶
func Wiki_search ¶
Types ¶
type IPtrkEntry ¶
func IPtrk_List ¶
func IPtrk_List(ctx PfCtx) (ts []IPtrkEntry, err error)
type OAuth2Claims ¶
type OAuth2Claims struct { JWTClaims ClientID string `json:"oa_client_id"` Scope string `json:"oa_scope"` RType string `json:"oa_rtype,omitempty"` Redirect string `json:"oa_redirect,omitempty"` }
func OAuth2_AuthToken_Check ¶
func OAuth2_AuthToken_Check(tok string) (claims *OAuth2Claims, err error)
type OAuth_Auth ¶
type OAuth_Auth struct { ClientID string `label:"Client ID" pfset:"nobody" pfget:"none"` Scope string `label:"Scope" pfset:"nobody" pfget:"none"` RType string `label:"Request Type" pfset:"nobody" pfget:"none"` Redirect string `label:"Redirect URL" pfset:"nobody" pfget:"none"` Auth string `label:"Authorize" pftype:"submit"` Deny string `label:"Deny" pftype:"submit" htmlclass:"deny"` }
type ObjFuncI ¶
type ObjFuncI struct {
// contains filtered or unexported fields
}
func ObjHasFunc ¶
type PTypeField ¶
type PTypeField struct {
reflect.StructField
}
func PTypeWrap ¶
func PTypeWrap(f reflect.StructField) PTypeField
type Perm ¶
type Perm uint64
const ( PERM_NOTHING Perm = 0 /* Nothing / empty permissions */ PERM_NONE Perm = 1 << iota /* No access bits needed (unauthenticated) */ PERM_GUEST /* Not authenticated */ PERM_USER /* User (authenticated) */ PERM_USER_SELF /* User when they selected themselves */ PERM_USER_NOMINATE /* User when doing nomination */ PERM_USER_VIEW /* User when just trying to view */ PERM_GROUP_MEMBER /* Member of the group */ PERM_GROUP_ADMIN /* Admin of the group */ PERM_GROUP_WIKI /* Group has Wiki section enabled */ PERM_GROUP_FILE /* Group has File section enabled */ PERM_GROUP_CALENDAR /* Group has Calendar section enabled */ PERM_SYS_ADMIN /* System Administrator */ PERM_SYS_ADMIN_CAN /* Can be a System Administrator */ PERM_CLI /* When CLI is enabled */ PERM_API /* When API is enabled */ PERM_OAUTH /* When OAUTH is enabled */ PERM_LOOPBACK /* Connected from Loopback */ PERM_HIDDEN /* Option is hidden */ PERM_NOCRUMB /* Don't add a crumb for this menu */ PERM_NOSUBS /* No sub menus for this menu entry */ PERM_NOBODY /* Nobody has access */ /* Application permissions */ PERM_APP_0 PERM_APP_1 PERM_APP_2 PERM_APP_3 PERM_APP_4 PERM_APP_5 PERM_APP_6 PERM_APP_7 PERM_APP_8 PERM_APP_9 )
type PfAppPermsI ¶
type PfAudit ¶
type PfConfig ¶
type PfConfig struct { Conf_root string `` /* From command line option or default setting */ File_roots []string `json:"file_roots"` /* Where we look for files */ Var_root string `json:"var_root"` /* Where variable files are stored */ Tmp_roots []string `json:"tmp_roots"` /* Templates */ LogFile string `json:"logfile"` /* Where to write our log file (with logrotate support) */ Token_prv interface{} `` Token_pub interface{} `` UserAgent string `json:"useragent"` CSS []string `json:"css"` Javascript []string `json:"javascript"` CSP string `json:"csp"` XFF []string `json:"xff_trusted_cidr"` XFFc []*net.IPNet `` Db_host string `json:"db_host"` Db_port string `json:"db_port"` Db_name string `json:"db_name"` Db_user string `json:"db_user"` Db_pass string `json:"db_pass"` Db_ssl_mode string `json:"db_ssl_mode"` Db_admin_db string `json:"db_admin_db"` Db_admin_user string `json:"db_admin_user"` Db_admin_pass string `json:"db_admin_pass"` Nodename string `json:"nodename"` Http_host string `json:"http_host"` Http_port string `json:"http_port"` JWT_prv string `json:"jwt_key_prv"` JWT_pub string `json:"jwt_key_pub"` Application interface{} `json:"application"` Username_regexp string `json:"username_regexp"` UserHomeLinks bool `json:"user_home_links"` SMTP_host string `json:"smtp_host"` SMTP_port string `json:"smtp_port"` SMTP_SSL string `json:"smtp_ssl"` Msg_mon_from string `json:"msg_monitor_from"` Msg_mon_to string `json:"msg_monitor_to"` TimeFormat string `json:"timeformat"` DateFormat string `json:"dateformat"` PW_WeakDicts []string `json:"pw_weakdicts"` CFG_UserMinLen string `json:"username_min_length"` CFG_UserExample string `json:"username_example"` TransDefault string `json:"translation_default"` TransLanguages []string `json:"translation_languages"` }
var Config PfConfig
func (*PfConfig) GetAppConfig ¶
func (*PfConfig) GetAppConfigBool ¶
func (*PfConfig) Token_LoadPrv ¶
func (*PfConfig) Token_LoadPub ¶
type PfCtx ¶
type PfCtx interface { GetAbort() <-chan bool SetAbort(abort <-chan bool) StoreCreds() (creds PfCreds) RestoreCreds(creds PfCreds) SetTx(tx *Tx) GetTx() (tx *Tx) Err(message string) Errf(format string, a ...interface{}) Log(message string) Logf(format string, a ...interface{}) Dbg(message string) Dbgf(format string, a ...interface{}) Init() (err error) SetStatus(code int) GetStatus() (code int) SetReturnCode(rc int) GetReturnCode() (rc int) GetLoc() string GetLastPart() string Become(user PfUser) GetToken() (tok string) NewToken() (err error) LoginToken(tok string) (expsoon bool, err error) Login(username string, password string, twofactor string) (err error) Logout() IsLoggedIn() bool IsGroupMember() bool IAmGroupAdmin() bool IAmGroupMember() bool GroupHasWiki() bool GroupHasFile() bool GroupHasCalendar() bool CanBeSysAdmin() bool SwapSysAdmin() bool IsSysAdmin() bool ConvertPerms(str string) (perm Perm, err error) IsPerm(perms Perm, perm Perm) bool IsPermSet(perms Perm, perm Perm) bool CheckPerms(what string, perms Perm) (ok bool, err error) CheckPermsT(what string, permstr string) (ok bool, err error) TheUser() (user PfUser) SelectedSelf() bool SelectedUser() (user PfUser) SelectedGroup() (grp PfGroup) SelectedML() (ml PfML) SelectedEmail() (email PfUserEmail) SelectedUser2FA() (tfa PfUser2FA) HasSelectedUser() bool HasSelectedGroup() bool HasSelectedML() bool SelectMe() SelectUser(username string, perms Perm) (err error) SelectUser2FA(id int, perms Perm) (err error) SelectGroupA(grp PfGroup, gr_name string, perms Perm) (err error) SelectGroup(gr_name string, perms Perm) (err error) SelectML(ml_name string, perms Perm) (err error) SelectEmail(email string) (err error) SetModOpts(opts PfModOptsI) GetModOpts() (opts interface{}) PDbgf(what string, perm Perm, format string, a ...interface{}) Out(txt string) Outf(format string, a ...interface{}) OutLn(format string, a ...interface{}) SetOutUnbuffered(obj interface{}, fun string) OutBuffered(on bool) IsBuffered() bool Buffered() (o string) GetRemote() (remote string) SetClient(clientip net.IP, remote string, ua string) GetClientIP() net.IP GetUserAgent() (string, string, string) SelectObject(obj *interface{}) SelectedObject() (obj *interface{}) GetLanguage() string SetLanguage(name string) GetTfunc() i18n.TranslateFunc NewUser() (user PfUser) NewUserI() (i interface{}) NewGroup() (user PfGroup) NewGroupI() (i interface{}) /* Menu Overrides */ MenuOverride(menu *PfMenu) /* menu.go */ Menu(args []string, menu PfMenu) (err error) WalkMenu(args []string) (menu *PfMEntry, err error) Cmd(args []string) (err error) CmdOut(cmd string, args []string) (msg string, err error) Batch(filename string) (err error) /* appdata */ SetAppData(data interface{}) GetAppData() interface{} }
Context Interface, allowing it to be extended
func NewPfCtx ¶
func NewPfCtx(newuser PfNewUserI, newgroup PfNewGroupI, menuoverride PfMenuI, appperms PfAppPermsI, postbecome PfPostBecomeI) PfCtx
type PfCtxS ¶
type PfCtxS struct {
// contains filtered or unexported fields
}
func (*PfCtxS) CanBeSysAdmin ¶
func (*PfCtxS) CheckPerms ¶
* Multiple permissions can be specified * thus test from least to most to see * if any of them allows access
func (*PfCtxS) CheckPermsT ¶
func (*PfCtxS) GetAppData ¶
func (ctx *PfCtxS) GetAppData() interface{}
func (*PfCtxS) GetClientIP ¶
func (*PfCtxS) GetLanguage ¶
func (*PfCtxS) GetLastPart ¶
func (*PfCtxS) GetModOpts ¶
func (ctx *PfCtxS) GetModOpts() (opts interface{})
func (*PfCtxS) GetReturnCode ¶
func (*PfCtxS) GetTfunc ¶
func (ctx *PfCtxS) GetTfunc() i18n.TranslateFunc
func (*PfCtxS) GroupHasCalendar ¶
func (*PfCtxS) GroupHasFile ¶
func (*PfCtxS) GroupHasWiki ¶
func (*PfCtxS) HasSelectedGroup ¶
func (*PfCtxS) HasSelectedML ¶
func (*PfCtxS) HasSelectedUser ¶
func (*PfCtxS) IAmGroupAdmin ¶
func (*PfCtxS) IAmGroupMember ¶
func (*PfCtxS) IsBuffered ¶
func (*PfCtxS) IsGroupMember ¶
func (*PfCtxS) IsLoggedIn ¶
func (*PfCtxS) IsSysAdmin ¶
func (*PfCtxS) MenuOverride ¶
func (*PfCtxS) OutBuffered ¶
func (*PfCtxS) RestoreCreds ¶
func (*PfCtxS) SelectEmail ¶
func (*PfCtxS) SelectGroupA ¶
Unless SysAdmin one cannot select a group one is not a member of
func (*PfCtxS) SelectObject ¶
func (ctx *PfCtxS) SelectObject(obj *interface{})
func (*PfCtxS) SelectUser ¶
This creates a PfUser
func (*PfCtxS) SelectedEmail ¶
func (ctx *PfCtxS) SelectedEmail() (email PfUserEmail)
func (*PfCtxS) SelectedGroup ¶
func (*PfCtxS) SelectedML ¶
func (*PfCtxS) SelectedObject ¶
func (ctx *PfCtxS) SelectedObject() (obj *interface{})
func (*PfCtxS) SelectedSelf ¶
func (*PfCtxS) SelectedUser ¶
func (*PfCtxS) SelectedUser2FA ¶
func (*PfCtxS) SetAppData ¶
func (ctx *PfCtxS) SetAppData(appdata interface{})
func (*PfCtxS) SetLanguage ¶
func (*PfCtxS) SetModOpts ¶
func (ctx *PfCtxS) SetModOpts(opts PfModOptsI)
func (*PfCtxS) SetOutUnbuffered ¶
func (*PfCtxS) SetReturnCode ¶
func (*PfCtxS) StoreCreds ¶
func (*PfCtxS) SwapSysAdmin ¶
type PfDB ¶
type PfDB struct {
// contains filtered or unexported fields
}
var DB PfDB
Global database variable - there can only be one
func (*PfDB) AppUpgrade ¶
func (*PfDB) Cleanup_psql ¶
func (*PfDB) Connect_def ¶
func (*PfDB) Exec ¶
func (db *PfDB) Exec(ctx PfCtx, audittxt string, affected int64, query string, args ...interface{}) (err error)
Exec() with forced requirement for audit message
func (*PfDB) GetAppSchemaVersion ¶
func (*PfDB) GetSchemaVersion ¶
func (*PfDB) Q_AddMultiClose ¶
func (*PfDB) Q_AddWhere ¶
func (*PfDB) Q_AddWhereAnd ¶
func (*PfDB) Q_AddWhereAndN ¶
func (*PfDB) Q_AddWhereOpAnd ¶
func (*PfDB) Q_AddWhereOr ¶
func (*PfDB) Q_AddWhereOrN ¶
func (*PfDB) QueryRowA ¶
func (db *PfDB) QueryRowA(ctx PfCtx, audittxt string, query string, args ...interface{}) (trow *Row)
Query for a Row, with an Audittxt for situations where the query is an INSERT/UPDATE with RETURNING
func (*PfDB) QueryRowNA ¶
Query for a Row, without Audittxt; use with care
func (*PfDB) SetAppVersion ¶
func (*PfDB) Setup_psql ¶
func (*PfDB) TxRollback ¶
func (*PfDB) UpdateField ¶
func (*PfDB) UpdateFieldMsg ¶
func (*PfDB) UpdateFieldMulti ¶
func (*PfDB) UpdateFieldMultiMsg ¶
func (*PfDB) UpdateFieldNP ¶
type PfDetail ¶
func DetailList ¶
type PfFile ¶
type PfFile struct { File_id int `pfcol:"id" pftable:"file"` Path string `pfcol:"path" pftable:"file_namespace"` Filename string `pfcol:"filename" pftable:"file"` Revision int `pfcol:"revision"` Entered time.Time `pfcol:"entered" pftable:"file_rev"` Description string `pfcol:"description"` SHA512 string `pfcol:"sha512"` Size int64 `pfcol:"size"` MimeType string `pfcol:"mimetype"` UserName string `pfcol:"member" pftable:"file_rev"` FullName string `pfcol:"descr" pftable:"member"` ChangeMsg string `pfcol:"changemsg"` FullPath string /* Not in the DB, see ApplyModOpts() */ FullFileName string /* Not in the DB, see ApplyModOpts() */ }
func File_ChildPagesList ¶
func File_RevisionList ¶
func (*PfFile) ApplyModOpts ¶
Add some stuff we do not store in the DB but are useful
type PfFileOpts ¶
type PfFileOpts struct {
PfModOptsS
}
func File_GetModOpts ¶
func File_GetModOpts(ctx PfCtx) PfFileOpts
type PfFileResult ¶
type PfGroup ¶
type PfGroup interface { String() string GetGroupName() string GetGroupDesc() string HasWiki() bool HasFile() bool HasCalendar() bool Refresh() (err error) Exists(group_name string) (exists bool) Select(ctx PfCtx, group_name string, perms Perm) (err error) GetGroups(ctx PfCtx, username string) (groups []PfGroupMember, err error) GetGroupsAll() (groups []PfGroupMember, err error) GetKeys(ctx PfCtx, keyset map[[16]byte][]byte) (err error) IsMember(user string) (ismember bool, isadmin bool, out PfMemberState, err error) ListGroupMembersTot(search string) (total int, err error) ListGroupMembers(search string, username string, offset int, max int, nominated bool, inclhidden bool, exact bool) (members []PfGroupMember, err error) Add_default_mailinglists(ctx PfCtx) (err error) Member_add(ctx PfCtx) (err error) Member_remove(ctx PfCtx) (err error) Member_set_state(ctx PfCtx, state string) (err error) Member_set_admin(ctx PfCtx, isadmin bool) (err error) GetVcards() (vcard string, err error) // contains filtered or unexported methods }
func NewPfGroup ¶
func NewPfGroup() PfGroup
Should not be directly called, use ctx or cui.NewGroup() instead
type PfGroupMember ¶
type PfGroupMember interface { SQL_Selects() string SQL_Froms() string SQL_Scan(rows *Rows) (err error) Set(groupname, groupdesc, username, fullname, affiliation string, groupadmin bool, groupstate string, cansee bool, email, pgpkey_id, entered, activity, telephone, sms, airport string) GetGroupName() string GetGroupDesc() string GetUserName() string GetFullName() string GetEmail() string GetAffiliation() string GetGroupAdmin() bool GetGroupState() string GetGroupCanSee() bool GetPGPKeyID() string HasPGP() bool GetEntered() string GetActivity() string GetTel() string GetSMS() string GetAirport() string }
func NewPfGroupMember ¶
func NewPfGroupMember() PfGroupMember
type PfGroupMemberS ¶
type PfGroupMemberS struct { UserName string FullName string Email string Affiliation string GroupAdmin bool GroupState string GroupCanSee bool GroupName string GroupDesc string PGPKeyID string Entered string Activity string Tel string SMS string Airport string }
func (*PfGroupMemberS) GetActivity ¶
func (grpm *PfGroupMemberS) GetActivity() string
func (*PfGroupMemberS) GetAffiliation ¶
func (grpm *PfGroupMemberS) GetAffiliation() string
func (*PfGroupMemberS) GetAirport ¶
func (grpm *PfGroupMemberS) GetAirport() string
func (*PfGroupMemberS) GetEmail ¶
func (grpm *PfGroupMemberS) GetEmail() string
func (*PfGroupMemberS) GetEntered ¶
func (grpm *PfGroupMemberS) GetEntered() string
func (*PfGroupMemberS) GetFullName ¶
func (grpm *PfGroupMemberS) GetFullName() string
func (*PfGroupMemberS) GetGroupAdmin ¶
func (grpm *PfGroupMemberS) GetGroupAdmin() bool
func (*PfGroupMemberS) GetGroupCanSee ¶
func (grpm *PfGroupMemberS) GetGroupCanSee() bool
func (*PfGroupMemberS) GetGroupDesc ¶
func (grpm *PfGroupMemberS) GetGroupDesc() string
func (*PfGroupMemberS) GetGroupName ¶
func (grpm *PfGroupMemberS) GetGroupName() string
func (*PfGroupMemberS) GetGroupState ¶
func (grpm *PfGroupMemberS) GetGroupState() string
func (*PfGroupMemberS) GetPGPKeyID ¶
func (grpm *PfGroupMemberS) GetPGPKeyID() string
func (*PfGroupMemberS) GetSMS ¶
func (grpm *PfGroupMemberS) GetSMS() string
func (*PfGroupMemberS) GetTel ¶
func (grpm *PfGroupMemberS) GetTel() string
func (*PfGroupMemberS) GetUserName ¶
func (grpm *PfGroupMemberS) GetUserName() string
func (*PfGroupMemberS) HasPGP ¶
func (grpm *PfGroupMemberS) HasPGP() bool
func (*PfGroupMemberS) SQL_Froms ¶
func (grpm *PfGroupMemberS) SQL_Froms() string
func (*PfGroupMemberS) SQL_Scan ¶
func (grpm *PfGroupMemberS) SQL_Scan(rows *Rows) (err error)
func (*PfGroupMemberS) SQL_Selects ¶
func (grpm *PfGroupMemberS) SQL_Selects() (q string)
type PfGroupS ¶
type PfGroupS struct { GroupName string `label:"Group Name" pfset:"nobody" pfget:"group_member" pfcol:"ident"` GroupDesc string `label:"Description" pfcol:"descr" pfset:"group_admin"` PGP_Required bool `label:"PGP Required" pfset:"group_admin"` Has_Wiki bool `label:"Wiki Module" pfset:"group_admin"` Has_File bool `label:"Files Module" pfset:"group_admin"` Has_Calendar bool `label:"Calendar Module" pfset:"group_admin"` Button string `label:"Update Group" pftype:"submit"` }
func (*PfGroupS) Add_default_mailinglists ¶
func (*PfGroupS) GetGroupDesc ¶
func (*PfGroupS) GetGroupName ¶
func (*PfGroupS) GetGroups ¶
func (grp *PfGroupS) GetGroups(ctx PfCtx, username string) (members []PfGroupMember, err error)
* Return the set of groups that the username is connected to * If active is set nominations will also appear
func (*PfGroupS) GetGroupsAll ¶
func (grp *PfGroupS) GetGroupsAll() (members []PfGroupMember, err error)
func (*PfGroupS) HasCalendar ¶
func (*PfGroupS) ListGroupMembers ¶
func (grp *PfGroupS) ListGroupMembers(search string, username string, offset int, max int, nominated bool, inclhidden bool, exact bool) (members []PfGroupMember, err error)
Note: This implementation does not use the 'username' variable, but other implementations might
func (*PfGroupS) ListGroupMembersTot ¶
func (*PfGroupS) Member_add ¶
func (*PfGroupS) Member_remove ¶
func (*PfGroupS) Member_set_admin ¶
func (*PfGroupS) Member_set_state ¶
type PfLanguage ¶
func LanguageList ¶
func LanguageList() (languages []PfLanguage, err error)
func (*PfLanguage) ToString ¶
func (tl *PfLanguage) ToString() (out string)
type PfMEntry ¶
type PfML ¶
type PfML struct { ListName string `label:"List Name" pfset:"nobody" pfget:"user" pfcol:"lhs" hint:"Name of this Mailing List"` GroupName string `label:"Group Name" pfset:"nobody" pfget:"user" pfcol:"trustgroup" hint:"Group this list belongs to"` Descr string `label:"Description" pfset:"group_admin" hint:"Description of this list"` Members_only bool `label:"Members Only" pfset:"group_admin" hint:"Only list members can post to this list"` Can_add_self bool `label:"Can Add Self" pfset:"group_admin" hint:"Can members of the group subscribe themselves to the list?"` Automatic bool `label:"Automatic" pfset:"group_admin" hint:"If new group members are automatically added to the list"` Always_crypt bool `label:"Always Encrypt" pfset:"group_admin" hint:"Always require messages to be PGP encrypted"` Pubkey string `label:"Public PGP Key" pfset:"nobody" pfget:"user" pfcol:"pubkey"` Seckey string `label:"Secret PGP Key" pfset:"nobody" pfget:"nobody" pfcol:"seckey" pfskipfailperm:"yes"` Address string /* Not retrieved with Fetch() */ Button string `label:"Update Configuration" pftype:"submit"` Members int /* Not retrieved with Fetch() */ Subscribed bool /* Not retrieved with Fetch() */ }
func (*PfML) ListGroupMembers ¶
func (*PfML) ListGroupMembersMax ¶
func (*PfML) ListWithUser ¶
type PfMLUser ¶
type PfMLUser struct { UserName string Uuid string FullName string Affiliation string IsSysAdmin bool LoginAttempts int }
func (*PfMLUser) GetAffiliation ¶
func (*PfMLUser) GetFullName ¶
func (*PfMLUser) GetUserName ¶
type PfMemberState ¶
type PfMemberState struct {
// contains filtered or unexported fields
}
type PfMenu ¶
type PfMenu struct {
M []PfMEntry
}
func StructMenu ¶
func StructMenu(ctx PfCtx, subjects []string, obj interface{}, onlyslices bool, fun PfFunc) (menu PfMenu, err error)
Create a "get" or "set" menu from a struct
func StructMenuA ¶
type PfMessage ¶
type PfMessage struct { Id int `pfcol:"id"` Path string `pfcol:"path"` Depth int `pfcol:"depth"` Title string `pfcol:"title"` Plaintext string `pfcol:"plaintext"` HTML template.HTML `pfcol:"html"` Entered time.Time `pfcol:"entered"` UserName string `pfcol:"member"` FullName string `pfcol:"descr" pftable:"member"` Seen pq.NullTime `pfcol:"entered" pftable:"msg_read"` }
type PfModOptsI ¶
type PfModOptsI interface {
IsModOpts() bool
}
type PfModOptsS ¶
type PfModOptsS struct { /* CLI command prefix, eg 'group wiki' */ Cmdpfx string /* URL prefix, typically System_Get().PublicURL() */ URLpfx string /* Path Root */ Pathroot string /* URL root, inside the hostname, eg '/group/name/wiki/' */ URLroot string }
func PfModOpts ¶
func PfModOpts(ctx PfCtx, cmdpfx string, path_root string, web_root string) PfModOptsS
func (PfModOptsS) IsModOpts ¶
func (m PfModOptsS) IsModOpts() bool
type PfMsgOpts ¶
type PfMsgOpts struct { PfModOptsS /* * How deep messages are still considered Subjects * Thread_depth + 1 == messages */ Thread_depth int /* Subforum title */ Title string }
func Msg_GetModOpts ¶
type PfNewGroupI ¶
type PfNewGroupI func() (user PfGroup)
type PfNewUserI ¶
type PfNewUserI func() (user PfUser)
type PfPass ¶
type PfPass struct { }
func (*PfPass) Verify ¶
* hashedPassword is in the semi-standardized /etc/shadow passwd format * the format can be: * $<hashtype>$<salt>$<hash> * $<hashtype>$rounds=<iter>$<salt>$<hash>
func (*PfPass) VerifyHOTP ¶
func (*PfPass) VerifyPWRules ¶
type PfPostBecomeI ¶
type PfPostBecomeI func(ctx PfCtx)
type PfPostCreateI ¶
type PfPostFetchI ¶
type PfSearchResult ¶
type PfSearcherI ¶
type PfSearcherI func(ctx PfCtx, c chan PfSearchResult, search string, abort <-chan bool) (err error)
type PfSys ¶
type PfSys struct { Name string `label:"System Name" pfset:"sysadmin" hint:"Name of the System"` Welcome string `label:"Welcome Text" pftype:"text" pfset:"sysadmin" pfcol:"welcome_text" hint:"Welcome message shown on login page"` AdminName string `label:"Name of the Administrator(s)" pfset:"sysadmin" hint:"Name of the Administrator, shown at bottom of the page"` AdminEmail string `` /* 128-byte string literal not displayed */ AdminEmailPublic bool `` /* 139-byte string literal not displayed */ CopyYears string `label:"Copyright Years" pfset:"sysadmin" hint:"Years that copyright ownership is claimed"` EmailDomain string `label:"Email Domain" pfset:"sysadmin" pfcol:"email_domain" hint:"The domain where emails are sourced from"` PublicURL string `` /* 178-byte string literal not displayed */ PeopleDomain string `` /* 154-byte string literal not displayed */ CLIEnabled bool `` /* 169-byte string literal not displayed */ APIEnabled bool `` /* 187-byte string literal not displayed */ OAuthEnabled bool `` /* 166-byte string literal not displayed */ NoIndex bool `` /* 140-byte string literal not displayed */ EmailSig string `label:"Email Signature" pftype:"text" pfset:"sysadmin" pfcol:"email_sig" hint:"Signature appended to mailinglist messages"` Require2FA bool `` /* 161-byte string literal not displayed */ PW_comment string `` /* 132-byte string literal not displayed */ PW_Enforce bool `pfsection:"Password Rules" label:"Enforce Rules" hint:"When enabled the rules below are enforced on new passwords"` PW_Length int `pfsection:"Password Rules" label:"Minimal Password Length (suggested: 12, min: 8)" min:"8"` PW_LengthMax int `pfsection:"Password Rules" label:"Maximal Password Length (suggested: 1024)"` PW_Letters int `pfsection:"Password Rules" label:"Minimum amount of Letters"` PW_Uppers int `pfsection:"Password Rules" label:"Minimum amount of Uppercase characters"` PW_Lowers int `pfsection:"Password Rules" label:"Minimum amount of Lowercase characters"` PW_Numbers int `pfsection:"Password Rules" label:"Minimum amount of Numbers"` PW_Specials int `pfsection:"Password Rules" label:"Minimum amount of Special characters"` SARestrict string `` /* 362-byte string literal not displayed */ HeaderImg string `label:"Header Image" pfset:"sysadmin" pfcol:"header_image" hint:"Image shown on the Welcome page"` LogoImg string `label:"Logo Image" pfset:"sysadmin" pfcol:"logo_image" hint:"Logo shown in the menu bar"` UnknownImg string `label:"Unknown Person Image" pfset:"sysadmin" pfcol:"unknown_image" hint:"Logo shown for users who do not have an image set"` ShowVersion bool `` /* 173-byte string literal not displayed */ Button string `label:"Update Settings" pftype:"submit"` // contains filtered or unexported fields }
func System_Get ¶
func System_Get() (system *PfSys)
type PfUser ¶
type PfUser interface { SetUserName(name string) GetUserName() string SetFullName(name string) GetFullName() string SetFirstName(name string) GetFirstName() string SetLastName(name string) GetLastName() string SetSysAdmin(isone bool) CanBeSysAdmin() bool IsSysAdmin() bool GetLoginAttempts() int GetUuid() string GetAffiliation() string GetGroups(ctx PfCtx) (groups []PfGroupMember, err error) IsMember(ctx PfCtx, groupname string) (ismember bool) GetListMax(search string) (total int, err error) GetList(ctx PfCtx, search string, offset int, max int, exact bool) (users []PfUser, err error) Refresh(ctx PfCtx) (err error) Select(ctx PfCtx, username string, perms Perm) (err error) SetRecoverToken(ctx PfCtx, token string) (err error) GetImage(ctx PfCtx) (img []byte, err error) GetHideEmail() (hide_email bool) GetKeys(ctx PfCtx, keyset map[[16]byte][]byte) (err error) GetDetails() (details []PfUserDetail, err error) GetLanguages() (languages []PfUserLanguage, err error) Get(what string) (val string, err error) GetTime(what string) (val time.Time, err error) SetPassword(ctx PfCtx, pwtype string, password string) (err error) CheckAuth(ctx PfCtx, username string, password string, twofactor string) (err error) Verify_Password(ctx PfCtx, password string) (err error) GetSF() (sf string, err error) GetPriEmail(ctx PfCtx, recovery bool) (tue PfUserEmail, err error) GetPriEmailString(ctx PfCtx, recovery bool) (email string) Fetch2FA() (tokens []PfUser2FA, err error) Verify_TwoFactor(ctx PfCtx, twofactor string, id int) (err error) GetLastActivity(ctx PfCtx) (entered time.Time, ip string) Create(ctx PfCtx, username string, email string, bio_info string, affiliation string, descr string) (err error) PostCreate(ctx PfCtx) (err error) PostFetch(ctx PfCtx, username string, in_err error) (err error) // contains filtered or unexported methods }
func NewPfUser ¶
func NewPfUser(postcreate PfPostCreateI, postfetch PfPostFetchI) PfUser
Should not be directly called, use ctx or cui.NewUser() instead
func NewPfUserA ¶
func NewPfUserA() PfUser
type PfUser2FA ¶
type PfUser2FA struct { Id int `label:"ID" pfset:"none" pfcol:"id"` UserName string `label:"UserName" pfset:"self" pfcol:"member" pftype:"ident" hint:"Owner of the Token"` Name string `label:"Description" pfset:"self" pfcol:"descr" hint:"Helpful name of the token"` Type string `label:"Type" pfset:"self" pfcol:"type"` Entered time.Time `label:"Entered" pfset:"nobody" pfget:"user"` Active bool `label:"Active" pfset:"self" pfcol:"active" hint:"Is the token active"` Key string `label:"Key" pfset:"self" pfcol:"key"` Counter int `trilanel:"Count" pfset:"self" pfcol:"counter" hint:"HOTP counter"` }
func NewPfUser2FA ¶
func NewPfUser2FA() *PfUser2FA
type PfUserEmail ¶
type PfUserEmail struct { Member string `label:"Member" pfset:"self" pfcol:"member" pftype:"ident" hint:"Owner of the Verification Code"` FullName string `label:"Full Name" pfset:"none" pftable:"member" pfcol:"descr"` Email string `label:"Email" pftype:"email" pfset:"none" pfcol:"email"` PgpKeyID string `label:"PGP Key ID" pfset:"none" pfcol:"pgpkey_id"` PgpKeyExpire time.Time `label:"PGP Key Expire" pfset:"nobody" pfget:"user" pfcol:"pgpkey_expire"` Keyring string `label:"Keyring" pftype:"file" pfset:"self" pfcol:"keyring"` KeyringUpdate time.Time `label:"Keyring Updated At" pfset:"nobody" pfget:"user" pfcol:"keyring_update_at"` VerifyCode string `label:"Verification Code" pfset:"nobody" pfget:"user" pfcol:"verify_token"` Verified bool `label:"Verified" pfset:"nobody" pfget:"user" pfcol:"verified"` Groups []PfGroupMember /* Used by List() */ }
func NewPfUserEmail ¶
func NewPfUserEmail() *PfUserEmail
func (*PfUserEmail) Fetch ¶
func (uem *PfUserEmail) Fetch(email string) (err error)
func (*PfUserEmail) FetchGroups ¶
func (uem *PfUserEmail) FetchGroups(ctx PfCtx) (err error)
func (*PfUserEmail) List ¶
func (uem *PfUserEmail) List(ctx PfCtx, user PfUser) (emails []PfUserEmail, err error)
type PfUserLanguage ¶
type PfUserLanguage struct { Language PfLanguage Skill string Entered time.Time }
type PfUserS ¶
type PfUserS struct { Uuid string `label:"UUID" coalesce:"00000000-0000-0000-0000-000000000000" pfset:"nobody" pfget:"sysadmin" pfskipfailperm:"yes"` Image string `` /* 156-byte string literal not displayed */ UserName string `label:"User Name" pfset:"self" pfget:"user_view" pfcol:"ident" min:"3" hint:"The username of this user" pfformedit:"no"` FullName string `label:"Full Name" pfset:"self" pfget:"user_view" pfcol:"descr" hint:"Full Name of this user"` FirstName string `label:"First Name" pfset:"self" pfget:"user_view" pfcol:"name_first" hint:"The First Name of the user"` LastName string `label:"Last Name" pfset:"self" pfget:"user_view" pfcol:"name_last" hint:"The Last name of the user"` Affiliation string `label:"Affiliation" pfset:"self" pfget:"user_view" hint:"Who the user is affiliated to"` Postal string `` /* 129-byte string literal not displayed */ Sms string `` /* 128-byte string literal not displayed */ Im string `label:"I.M." pfset:"self" pfget:"user_view" pfcol:"im_info" hint:"Instant Messaging details"` Timezone string `label:"Timezone" pfset:"self" pfget:"user_view" pfcol:"tz_info" hint:"Timezone details"` Telephone string `` /* 149-byte string literal not displayed */ Airport string `label:"Airport" min:"3" max:"3" pfset:"self" pfget:"user_view" hint:"Closest airport for this user"` Biography string `label:"Biography" pftype:"text" pfset:"self" pfget:"user_view" pfcol:"bio_info" hint:"Biography for this user"` IsSysadmin bool `` /* 152-byte string literal not displayed */ CanBeSysadmin bool `` /* 171-byte string literal not displayed */ LoginAttempts int `` /* 187-byte string literal not displayed */ No_email bool `` /* 137-byte string literal not displayed */ Hide_email bool `` /* 156-byte string literal not displayed */ RecoverEmail string `` /* 154-byte string literal not displayed */ Furlough bool `label:"Furlough" pfset:"self" pfget:"user,user_view" hint:"Extended holiday or furlough"` Entered time.Time `label:"Entered" pfset:"nobody" pfget:"user,user_view" hint:"Timestamp in UTC"` Activity time.Time `label:"Last Activity" pfset:"nobody" pfget:"user,user_view" hint:"Timestamp in UTC"` Button string `label:"Update Profile" pftype:"submit"` Password string `pfset:"nobody" pfget:"nobody" pfskipfailperm:"yes"` Passwd_chat string `pfset:"nobody" pfget:"nobody" pfskipfailperm:"yes"` // contains filtered or unexported fields }
* All values have to be exportable, otherwise our StructFetch() etc tricks do not work * * But that is also the extent that these should be used, they should always be accessed * using the interface, not directly (direct access only internally). * * Even templates need to use Get*() variants as they receive interfaces.
func (*PfUserS) CanBeSysAdmin ¶
func (*PfUserS) GetAffiliation ¶
func (*PfUserS) GetDetails ¶
func (user *PfUserS) GetDetails() (details []PfUserDetail, err error)
func (*PfUserS) GetFirstName ¶
func (*PfUserS) GetFullName ¶
func (*PfUserS) GetGroups ¶
func (user *PfUserS) GetGroups(ctx PfCtx) (groups []PfGroupMember, err error)
func (*PfUserS) GetHideEmail ¶
func (*PfUserS) GetLanguages ¶
func (user *PfUserS) GetLanguages() (output []PfUserLanguage, err error)
func (*PfUserS) GetLastActivity ¶
func (*PfUserS) GetLastName ¶
func (*PfUserS) GetList ¶
func (user *PfUserS) GetList(ctx PfCtx, search string, offset int, max int, exact bool) (users []PfUser, err error)
TODO: Verify: Only show member of groups my user is associated with and are non-anonymous
func (*PfUserS) GetLoginAttempts ¶
func (*PfUserS) GetPriEmail ¶
func (user *PfUserS) GetPriEmail(ctx PfCtx, recovery bool) (tue PfUserEmail, err error)
Extends PfUserS
func (*PfUserS) GetPriEmailString ¶
func (*PfUserS) GetUserName ¶
func (*PfUserS) IsSysAdmin ¶
func (*PfUserS) PostCreate ¶
func (*PfUserS) SetFirstName ¶
func (*PfUserS) SetFullName ¶
func (*PfUserS) SetLastName ¶
func (*PfUserS) SetPassword ¶
func (*PfUserS) SetRecoverToken ¶
func (*PfUserS) SetSysAdmin ¶
func (*PfUserS) SetUserName ¶
func (*PfUserS) SharedGroups ¶
func (*PfUserS) Verify_Password ¶
* This only verifies the "portal" password * * Chat & jabber passwords are directly checked by ircd & ejabberd
type PfWikiHTML ¶
type PfWikiMarkdown ¶
type PfWikiMarkdown struct {
Markdown string `pfcol:"markdown"`
}
type PfWikiOpts ¶
type PfWikiOpts struct {
PfModOptsS
}
func Wiki_GetModOpts ¶
func Wiki_GetModOpts(ctx PfCtx) PfWikiOpts
type PfWikiPage ¶
type PfWikiPage struct { Path string Entered time.Time Title string FullPath string /* Not in the DB, see ApplyModOpts() */ }
func Wiki_ChildPagesList ¶
func (*PfWikiPage) ApplyModOpts ¶
func (wiki *PfWikiPage) ApplyModOpts(ctx PfCtx)
type PfWikiResult ¶
func Wiki_SearchList ¶
type PfWikiRev ¶
type SessionClaims ¶
type StructDetails_Options ¶
type StructDetails_Options int
const ( SD_None = 0 SD_Perms_Check StructDetails_Options = 0 << iota SD_Perms_Ignore SD_Tags_Require SD_Tags_Ignore )
Source Files ¶
- app.go
- cfg.go
- ctx.go
- db.go
- detail.go
- diff.go
- file.go
- file_search.go
- group.go
- groupmember.go
- iptrk.go
- jwt.go
- jwt_invalid.go
- language.go
- mail.go
- mainmenu.go
- menu.go
- messages.go
- misc.go
- ml.go
- oauth2.go
- pw.go
- pw_dict.go
- search.go
- setup.go
- struct.go
- system.go
- template.go
- translate.go
- user.go
- user_2fa.go
- user_detail.go
- user_email.go
- user_events.go
- user_language.go
- wiki.go
- wiki_export.go
- wiki_import.go
- wiki_rnd.go
- wiki_search.go