Commit Graph

9813 Commits

Author SHA1 Message Date
Mark Smith a229a620d2 Fix some build steps
Also some tweaks so that the documentation and such works on my test
hack.
2023-01-04 07:12:58 +00:00
momijizukamori a0ca65ee1b
API tooling (#3033)
* Updates to API generation and tooling

- Added build script and build instructions for API files
- Updated `.gitignore` to keep node_module folders out, wherever they occur
- Rewrite existing YAML files to use new component system
- Compile rewritten YAML files
- Add more validation checks to the route builders and dispatchers
- Add a user-facing documentation page with interactive view using RapiDoc
- Add a generic 404 handler for missing routes under `/api`, which returns JSON instead of HTML
- Clean up spec output route slightly to make it valid OpenAPI 3.0.0

* Auto-fill API Key in docs

Co-authored-by: Cocoa <momijizukamori@gmail.com>
2023-01-03 22:42:09 -08:00
Cocoa 0e6739366f Refactor of button JS 2022-12-04 22:06:12 +00:00
Denise Paolucci b9ddeb84fe
Merge pull request #3040 from alansill/patch-2
Update comments to match license stated, add link
2022-11-22 13:19:54 -05:00
Denise Paolucci 28f8ed239d
Merge pull request #3039 from alansill/patch-1
Update comments to match license stated, add link
2022-11-22 13:19:18 -05:00
Mark Smith 62037b77fa
Remove timecheck column (#3015)
This column is unused, let's drop it.
2022-11-22 12:16:58 -05:00
Jen d71f904220
more generic fix for legacy country codes (#3031)
Years ago, we changed our source of country code data to use a
standard CPAN module.  This has largely worked well except for a
couple of odd corner cases where the previous country code stored in
user data didn't match up with the new source.  The obvious one was
the change from UK to GB, so we kludged in recognition for both codes,
and then deleted the older one anywhere it showed up as a duplicate in
a drop down menu.

Subsequently it was noted that there was a legacy code for Scotland
(LJSC) which needed the same treatment. Instead of continuing to
expand the kludge, this adds a second class method, load_legacy, to
use when requesting the version of the data that includes the older
codes. That way we can go back to calling the basic load method
without having to then delete the extra codes in the caller. And if we
stumble across any other missing codes, they'll be maintained in one
place.

Fixes #2197.
2022-11-22 12:08:52 -05:00
alierak 5b46f4df94
uncompress comment subject after retrieving from db (#3019) 2022-11-22 12:06:04 -05:00
Mark Smith b6cdf59812
Allow logging out multiple sessions/all sessions (#3016)
* Fix loginlog with long ua's

This trims useragents so they fit into the VARCHAR(100) that is the db
column. This also fixes so that we will log errors when we fail to
record logins, so this won't show up silently in production.

* Add multi-select and logout all

This adds the ability to log out multiple sessions at the same time as
well as to log out all sessions in one click, including the one you're
actively using.
2022-11-22 12:03:24 -05:00
Alan Sill 3b9fbac192
Update comments to match license stated, add link
Although the license stated in the text is CC-by-SA-2.5, the comments in the header stated inconsistent information apparently left over from use of that header in a code file. This pull request updates the comments to be consistent with the license stated, and adds a link to the license as required by the license terms for its use. I would like to fix these issues before making a copy to use on our own site with appropriate alterations and credit as per the license.

CODE TOUR: no-impact
2022-11-22 09:47:35 -06:00
Alan Sill fa97da7f08
Update comments to match license stated, add link
Although the license stated in the text is CC-by-SA-2.5, the comments in the header incorrectly stated contradictory information apparently left over from use of that header in a code file. This pull request updaes the comments to be consistent with the license stated, and adds a link to the license as required for its use. I would like to fix these issues before making a copy to use on our own site with appropriate alterations and credit as per the license.
2022-11-22 09:41:49 -06:00
momijizukamori 3390d01970
Merge pull request #3024 from kareila/location-results
limit directory search by location results to visible users
2022-11-18 20:24:22 -05:00
momijizukamori 2547f60cfc
Merge pull request #3014 from dreamwidth/mark/issue-3002
Rename hangouts to chat
2022-11-18 20:21:13 -05:00
momijizukamori 37986a727b
Merge pull request #3017 from dreamwidth/mark/issue-2968
Don't show adult journals/entries in Latest Things
2022-11-18 20:20:35 -05:00
momijizukamori 206fa43c9c
Merge pull request #3020 from alierak/jbackup-https
support https, note password must be an API key
2022-11-18 20:19:48 -05:00
momijizukamori 81fb6c4da9
Merge pull request #3028 from momijizukamori/utf8css
Remove high-byte check from CSS cleaner (it messes with utf8)
2022-11-18 19:28:53 -05:00
Cocoa cdfdaec518 Remove high-byte check from CSS cleaner (it messes with utf8) 2022-11-18 23:38:23 +00:00
Kareila 72326a5b4e limit directory search by location results to visible users
I took my cue from ContactInfo.pm, which mentions a desire
to avoid using load_userids on a large data set for filtering
purposes. Instead this expresses the visibility requirement as
an additional WHERE clause in the SELECT statement, acting only
on users that have rows in both the user and userprop tables.

Obviously my ability to test this locally is extremely limited,
but this should fix the problem with location results being
sparsely populated due to a large number of suspended SEO accounts.
2022-11-15 23:49:20 +00:00
Robby Griffin dc370990f6 support https, note password must be an API key 2022-11-11 23:23:06 -06:00
Mark Smith d86d239482 Only run workflows on main 2022-11-11 16:32:43 -08:00
Mark Smith 264b1a602c Don't show adult journals/entries in Latest Things
As it says on the tin.
2022-11-11 21:28:12 +00:00
Mark Smith 0c61e229b4 Rename hangouts to chat
Googly things. This probably works.
2022-11-11 12:17:16 -08:00
Kareila 7067577abb temporarily revert fix for #1339
Reports that this is interfering with the ability to purchase
paid time. Needs further investigation.
2022-11-11 09:40:42 -06:00
Mark Smith 4e286435cd Fixed, and tested 2022-11-11 02:49:05 +00:00
Mark Smith f3229ec660 Sigh, what I get for not testing x2 2022-11-10 18:44:09 -08:00
Mark Smith 8b066009e3 Sigh, what I get for not testing 2022-11-10 18:43:32 -08:00
Mark Smith 4f9b969f14 Serve from minified or max dir
Static content sometimes fails to compile, such as fckeditor, so this allows
us to fall back to the max/ directory (which contains the source files) if
we can't find the minified version.
2022-11-10 18:42:10 -08:00
Jen b81325aefd
new "finduser delve" console command (#3010)
* [#1184] don't enforce black text for console output

This changes the color value to "inherit" which should
use whatever the CSS has specified for body text.

* [#2921] tweaks to console command table styling

* [#2945] new 'finduser delve' command per request

Uses the finduser:infohistory priv, since it includes
data from the infohistory table.

Fixes #2945.
2022-11-10 18:35:29 -08:00
Mark Smith 5fb77ecf6d Build static in base
This will make web builds faster, at the cost of including static content in
the workers. (Oh well.)
2022-11-10 18:22:05 -08:00
Jen dcb2154aff
shop til you drop part 2 (#3008)
* not all CAP entries are created equal

This was generating "Use of uninitialized value in string eq at cgi-bin/DW/Shop/Item/Account.pm line 480."

* don't include staff accounts in "gift paid time" suggestion list

It just looks wrong, especially if you follow a LOT of official comms.

* add backlinks to shop pages for icons and points

The pages for accounts and rename tokens had these, but the others
did not.

* allow for=self paid time buyers to future date purchases

We were hiding all of the "gift" options on this version of
the form, but there are legit reasons for someone to want to
future-date a purchase for themselves. You could work around
it by visiting the for=gift version of the page and entering
your own username, but that's pointlessly annoying.

* [#1339] warn when purchasing regular paid time for premium account

You can override the warning by resubmitting the form with the
new checkbox checked, if you don't want to adjust the delivery date
or the type of account time.

Fixes #1339.

* warning should only include date if the logged-in user owns the account

* [#2917] include expiration date in paid time notification email
2022-11-10 12:00:50 -08:00
Mark Smith c6c12929c7 Delete carts open/closed for >30 days
These carts have been abandoned for one reason or another, so let's remove
them from the database -- they can't be used.
2022-11-10 06:55:02 -08:00
Jen afa02c2b13
final (for now) round of tellafriend fixes (#3005)
* hush uninitialized value warnings related to empty message body

* send from dw_null, reply-to user's own email

Currently, the header of the generated email looks like:

> From: "[[username]] via [[sitename]]" <[[user's email]]>

This updates it to come from $LJ::BOGUS_EMAIL,
with the user's email as a reply-to:

> From: "[[username]] via [[sitename]]" <[[dw_null@site]]>
> Reply-To: "[[username]]" <[[user's email]]>

This change also makes it more likely that the message will
actually be delivered by SES.

Fixes #1866.

* fix problem with $default_formdata being ignored

Since $r->post_args is never empty (it's a Hash::MultiValue object),
let's use the value of $r->did_post instead.

* update the form display to better reflect the actual email header

also displays the message subject, which was hidden before
2022-11-09 09:05:43 -08:00
Jen bfe9820342
shop til you drop (#3007)
* site configuration misbehavior: turning off shop components

It is easily possible to disable the individual sections of the shop
that sell icons, points, and rename tokens, but the storefront was
not designed to gracefully handle that configuration.

In the case of points or icons, the cart would throw a generic error
when submitting the form. In the case of rename tokens, the "Add To
Order" button would just silently fail.

Although it is unlikely DW will ever disable these shop items, let's
update the code to be better behaved on general principle.

(Unavailable account levels are already handled in a reasonable manner.)

This also adds the missing 'icons' key to the example %LJ::SHOP hash.

* site configuration misbehavior: turning off the shop entirely

Visiting any shop page with the 'payments' config option turned off
results in a completely blank page and an error in the logs that says:
Argument "The shop is currently disabled." isn't numeric.

Looks like this happened because of a misunderstanding about the intended
return value of DW::Controller::controller. The relevant code comment says
to return "error text" if there was an error, but the error message can't be
just a string, it has to be a server response. Perhaps the behavior was later
updated in order to allow other possible responses such as redirects.

At any rate, the fix is to use error_ml here. The subsequent sysban check
obviously has the same problem, so this fixes that as well.

* [#2974] enforce minimum amount for check/money order payments

Defines a new config parameter $LJ::SHOP_CMO_MINIMUM. If set
to a value greater than zero, that value will be the minimum
"cash" value required to accept check/money order payments.

Fixes #2974.

* [#2328] print the currency to 2 decimal places in receipt email

As reported some time ago, the "Amount Due" was being shown as e.g.
$20.2 instead of $20.20. Future emails will print the amount with
the standard number of decimal places.

Fixes #2328.

* new 'payments_cmo' option for LJ::is_enabled

As mentioned in #2974, it's possible that we may need to
entirely disable paying by check or money order in the
future due to increasing costs. This adds a 'payments_cmo'
test to LJ::is_enabled that will make the switch easy to
flip if that day comes.
2022-11-09 09:03:08 -08:00
Mark Smith 029cd6de19 Fix filtering subs from old clusters 2022-11-08 12:21:12 -08:00
Mark Smith b4f9730cd1 Use workers etc dir, so our configs match our unit of deployments 2022-11-08 09:57:47 -08:00
Mark Smith b305905dfc Workers should use etc-stable directory 2022-11-08 09:48:59 -08:00
momijizukamori 88648423da
Merge pull request #3006 from momijizukamori/inbox-tweaks-11-6
Fourth round of inbox tweaks!
2022-11-08 12:17:45 -05:00
Cocoa c7a0b846f5 Fourth round of inbox tweaks!
- Restores a confirmation check in JS for 'delete all'
- Adds some spacing above the Compose button
- Fixes current page link color in pagination
2022-11-08 17:13:51 +00:00
Mark Smith 1df2e7cd2f Tidy + add more debugging 2022-11-08 08:57:59 -08:00
Mark Smith d6c4c1c9cf Make error messages actually print 2022-11-08 08:39:44 -08:00
Kareila 9099c0ac8b [#2925] display edit link when viewer has faqedit priv
Another minor bit of admin functionality that went
walkabout when the page was converted away from BML.

Fixes #2925.
2022-11-05 23:48:54 -05:00
Kareila 8f160e3657 [#2897] update boilerplate text for config.pl.example 2022-11-05 23:48:11 -05:00
Robby Griffin 0b27704cc9 Don't check whether stats graphs exist on this particular webserver 2022-11-04 22:08:12 -05:00
Robby Griffin 32cab3d6ab Need libgd-text-perl for text in stats bar graphs 2022-11-04 22:08:12 -05:00
chebegeek 8d76dd83a3
Enable full screen video in embeds (#2998)
* Enable full screen video in embeds

* Undo whitespace changes
2022-10-25 20:30:42 -05:00
Kareila 7bf9564b9c a couple more tiny tweaks
Fix for a single quoted string that needed to be double quoted,
amd toss in a couple more fixes for undefined variable warnings.
2022-10-22 14:13:45 -05:00
Jen 9ce23e63d4
fix up /tools/tellafriend (#2993)
* tellafriend fixup pt 1

* The "forbiddenimages" string in the regex looked like a
  copy-paste error. This is the regex in the original BML.

* Assign an empty string to $msg so we don't get warnings
  about concatenating to an undefined variable.

* tellafriend fixup pt 2

* The main problem here is that the template was trying
  to call "form" methods as "dw" methods that didn't exist.

* Removed HTML table elements.

* Turned off Foundation styling because it made the page
  look weird. More work for another day.

* A few other typo fixes and regressions to the original BML.

* remove BML

* [#1866] site text improvements

It was bugging the stew out of me that this hadn't been
updated to use $LJ::NEWS_JOURNAL so I did that. I also
changed the bits of boilerplate text that I complained
about in #1866, and made the textarea a bit wider.

* bug in LatestNews widget on logged-in homepage

Obscure, but I just ran into this in testing: if you
set $LJ::NEWS_JOURNAL to a valid community but it
doesn't have any entries yet, the widget will bomb
out with a missing anum error.

This adds a validity check to the entry object before
attempting to do anything with it.

* [#1866] disallow /tools/tellafriend in robots.txt

As I mentioned in #1866, this page gets a lot of crawler
traffic because it's linked on every journal and entry.
Adding it here should tell well-behaved bots to ignore it.
2022-10-22 10:36:49 -07:00
Jen ede4d26236
add ext/dw-nonfree/htdocs/stc/css to .gitignore (#2992) 2022-10-20 10:35:02 +08:00
Jen acdeb3ca82
[#2969] check for expunged target user on manage/logins (#2987) 2022-10-20 10:34:39 +08:00
Jen d6a0899156
[#2960] don't double-escape URL parameters in returnto (#2991)
The form.hidden function applies escaping, so pass
the unescaped variable to the template.
2022-10-20 10:34:03 +08:00